Thank you for the replies. Regarding the GCD(x,y), this is the same solution I came up with but then I thought to myself "what about rotation?" So I think that's really where the question lies now, could rotating the rectangles get you a smaller perfect square than no rotation at all?