By counting carefully it can be seen that a rectangular grid measuring 3 by 2 contains eighteen rectangles:
For each testcase an integer target would be given . Consider all the rectangular grids such that the number of rectangles contained in the grid is nearest to target . Out of all such rectangular grids output the area of the rectangular grid having the largest area.
First line contains denoting the number of testcases.
The following lines contain an integer .
For each testcase print the area of the desired rectangular grid .
Case1: A grid contains 18 rectangles.
is 2 . The grid contains rectangle and the grids and contain rectangles each.
All other rectangular grids contain more than rectangles.
Hence The set of grids containing the number of rectangles nearest to are , , .
Out of these and are the grids having the largest area equal to .
Hence is the answer as it is the largest area in the set of rectangular grids being considered.