Micro in the Mirror World

3.1

7 votes
Easy-Medium
Problem

Micro has been watching Doraemon continuously for two days. So, when he sleeps today , its gonna be Doraemon all around. In his dream, he enters into the mirror world but now there is a problem, he isn't able to come out of the world because Doraemon has lost his pocket. Upon continuous efforts, he gets a clue by a stranger of the co-ordinate where there is Doraemon's pocket. The clue is:
Consider the mirror world as a matrix of n*n. FInd the floor value of the expected value of the area of a randomly chosen rectangle in the matrix.
Let this value be x. So, the co-ordinate of Doraemon's pocket is (x,x,x). As always you have to help Micro.

Input:
The first line contains an integer t (number of test cases).
Following t lines contain a number n each.

Output:
Print the floor value of the expected value in a new line for each test case.

Constraints:
1<=t<=100000
1<=n<=10^9
Each cell of the matrix is a square of area 1

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

n=3

enter image description here


Here, we have 9 rectangles(squares) of area 1.
12 rectangles of area 2.
6 rectangles of area 3
4 rectangles of area 4
4 rectangles of area 6
1 rectangles of area 9
Total number of rectangles are 9+12+6+4+4+1=36
So, expected value of area= 1 * 9/36 + 2 * 12/36 + 3 * 6/36+ 4 * 4/36+ 6 * 4/36+ 9 * 1/36=(1 * 9 + 2 * 12 + 3 * 6 + 4 * 4 + 6 * 4 + 9 * 1) / 36 = 100/ 36=2.777777778
floor value= 2

Editor Image

?