| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 72 | 49 | 40 | 78.431% |
Micchan noticed that an umbrella is a regular polygon when looking from above. So, she created the following problem.
Umbrella Query
A regular $N$ polygon has $N$ edges and $\frac{N(N-1)}{2} - N$ diagonals. Consider the union of them, which includes $\frac{N(N-1)}{2}$ line segments.
How many pairs of line segments satisfy the following 2ドル$ conditions?
Micchan has given $T$ of the above problems. However, her friend cannot solve too many requests. Answer each problem on her behalf.
$T$
$N_1$
$N_2$
$\vdots$
$N_T$
Output the answer in $T$ lines. On the $i$-th line, output the answer to the problem when $N = N_i$. Add a new line at the end of each line.
3 4 3 1000000000
4 0 499999999000000000
In Sample Input 1, you count only pairs of line segments that intersect perpendicularly at the vertices of the square.