Kaosar And Diagonals#12260

Kaosar And Diagonals

2 seconds
512 megabytes
Medium

There is a regular -sided shape with vertices labeled from to in clockwise order.

You can add a line segment with vertices and as endpoints only if \gcd(i,j)=1.

You have to say what's the total number of line segments after adding all possible vertices together.

Input

The first line will contain a single integer (1 \leq t \leq 1000) the total number of test cases.

Each test case will contain a single integer (3 \leq n \leq 2\cdot 10^5).

Output

Print the total number of line segment after adding all possible vertices together.

Examples

Example 19

Loading
Loading

Note

In the first test case, you can not add any line segment.

Figure for the first test case.

In the second test case, you can add a line segment with vertices and as endpoints. It can be proven that up to line segments can be added.

Figure for the second test case.

Scoring

  1. Subtask ( points): (1 \le n \le 10)

  2. Subtask ( points) : (1 \le \sum n \le 500)

  3. Subtask ( points) : (1 \le \sum n \le 2 \cdot 10^5)

  4. Subtask ( points): No additional constraints.