Problem 85: Counting rectangles

FCC link

By counting carefully it can be seen that a rectangular grid measuring 3 by 2 contains eighteen rectangles:

a diagram of the different rectangles found within a 3 by 2 rectangular grid

Although there exists no rectangular grid that contains exactly two million rectangles, find the area of the grid with the nearest solution.

Test

{{test}}

Console output