I think the problem asked us to divide a rectangle into "squares" not small rectangles, but it is not very clear.
I think it states pretty clear that rectangular is subdivided into square subregions.
Given a rectangular area with integral dimensions, that area can be subdivided into square subregions, also with integral dimensions. This process is known as tiling the rectangle. For such square-tiled rectangles...
A single integer can't encode a rectangle. If they would be rectangles, then you would see 1x2 2x3 4x5 in input files.