Square & Rectangle
Time Limit: 1 sec
The Problem
In this problem you have to find out how many different size square and rectangle hidden in (N*N) grid. Although one can count square and rectangle for (10*10) or (100*100) but what about more!
(2*2) grid 4 square + 1 square = 5 square.
And the 4 rectangles makes with square (1, 2), (3, 4), (1, 3) and (2, 4).
Now your task is to count the squares and rectangles for the given value.
The Input
The input starts with an integer T (T<=100), the number of test case. The next T lines will contain a single positive integer N (1<=N<=200).
The Output
For each line of input produce one line of output which contain 2 integers S and R. Where S is the number of squares in the grid and R is the number of rectangles in the grid.
Sample Input
2
2
4
Sample Output
5 4
30 70
[College Level]
ISCPC 2017 Preliminary
Problem Setter: Milton Deb