/*
* Zoj3175.c
*
* Created on: 2011-9-20
* Author: bjfuwangzhu
*/
/*
Question Description: given an N, evaluate 1, 2... N the approximate number of all numbers and F (N)
For example, F (5) = 10-5, F (4) = 8-4
Because N is very large, there are two ways to think about it. The first is to find the recursion or formula of the function. It seems very difficult and every clue
Another way of thinking is to calculate by segment, that is, the number of statistical intervals containing this approximate number, which can be calculated by O (1) time.
The next step is how to split this section. In fact, this problem is reflected in the coordinate system. For x * Y <= N, we need to find all the positive integer points in this graph.
We use a straight line x = y to divide this image into two parts. Obviously, these two parts are symmetric, so we can make I = [1, SQRT (n)] accumulate N/I (actually the section I mentioned earlier)
This is another * 2, but we noticed that we calculated the elements on the diagonal line twice, so we need to subtract K * K (k = SQRT (n ))
Why is this? We regard the whole point as the base point, that is, the area is obtained through the number base point. We correspond to the hyperbolic coordinate, and find that the overlapping part of Each recalculation is exactly a square.
Is K * k
*/
# Include <stdio. h>
# Include <math. h>
Typedef long ll;
Int main (){
# Ifndef online_judge
Freopen ("data. In", "r", stdin );
# Endif
Int T, I, Te, N;
Ll res;
While (~ Scanf ("% d", & T )){
While (t --){
Scanf ("% d", & N );
Te = (INT) SQRT (N * 1.0 );
For (I = 1, Res = 0; I <= tE; I ++ ){
Res + = N/I;
}
Res = (RES <1)-te * te;
Res-= N;
Printf ("% LLD \ n", Res );
}
}
Return 0;
}