Distinct rational numbers

Count distinct values of a/b with 0 <= a <= b <= N, i.e. fractions in [0,1] with reduced denominator at most N.

Medium5MathNumber theoryCombinatoricsPrefix sumNo attempts yetTime limit2sMemory limit512 MB

Problem

You are given a positive integer NN. Count how many distinct values the fraction ab\frac{a}{b} takes over all integers aa and bb with 0abN0 \le a \le b \le N. A denominator cannot be 00, so bb is at least 11. Fractions with the same value are counted once. For example, 12\frac{1}{2} and 24\frac{2}{4} have the same value, so they count as one.

Input

The first line contains the number of test cases tt (1t100001 \le t \le 10000). Each of the next tt lines contains one integer NN (2N100002 \le N \le 10000).

Output

For each test case, print the number of distinct rational numbers on its own line.