Given an integer $n$, we say a point $(x, y)$ on a 2D plane is a magic point, if and only if both $x$ and $y$ are integers, and exactly one of the following conditions is satisfied:

$0 \le x < n$ and $y = 0$;

$0 \le x < n$ and $y = n-1$;

$x = 0$ and $0 \le y < n$;

$x = n-1$ and $0 \le y < n$.

It's easy to discover that there are $(4n - 4)$ magic points in total. These magic points are numbered from $0$ to $4n-5$ in counter-clockwise order starting from $(0, 0)$.

DreamGrid can create $n$ magic lines from these magic points. Each magic line passes through exactly two magic points but cannot be parallel to the line $x = 0$ or $y = 0$ (that is to say, the coordinate axes).

The intersections of the magic lines are called dream points, and for some reason, DreamGrid would like to make as many dream points as possible. Can you tell him how to create these magic lines?

There are multiple test cases. The first line of input contains an integer $T$ (about 100), indicating the number of test cases. For each test case, there is only one integer $n$ ($2 \le n \le 1000$).

提交代码