All submissions for this problem are available.
A positive rational number is a real number which can be expressed as P/Q where P, Q are coprime positive intergers. The Chef is very hungry and can get food only if he solves the following question. "Given a number N, find the number of positive rational numbers less than 1 such that when expressed as P/Q, both P, Q are less than or equal to N". Please help the Chef in answering this question. The Chef promises to share the food with you.
The first line contain a single integer T, the number of test cases. Following T (<= 1000) lines will contain a test case, a single number N (<= 1000000).
For each test case print the output on a single line.
Input: 3 1 2 3 Output: 0 1 3
|Time Limit:||0.706897 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.