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; }
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.
For each test case, output will be a single line containing H(n).
範例輸入 1
2 5 10
範例輸出 1
10 27
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.