Problem G
H(n)
Input: Standard Input
Output: Standard Output
What is the value this simple C++ function will
return?
long long H(int n){
long long
res = 0;
for( int i
= 1; i <= n; i=i+1 ){
res =
(res + n/i);
}
return
res;
}
Input
The first line of input is an integer T ( T <= 1000 )
that indicates the number of test cases. Each of the next T line will contain a
single signed 32 bit integer n.
Output
For each test case, output will be a single line containing H(n).
2 5 10 |
10 27 |
Problem-setter: Md. Arifuzzaman Arif
Special Thanks: Shahriar Manzoor