아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Umbrella Queries

시간 제한2초메모리 제한1024 MB

요약
정N각형의 변과 대각선 중 한 꼭짓점을 공유하며 직각으로 만나는 두 선분의 쌍을 N마다 세는 문제이다.
난이도

보통10점 중 6점

유형
수학, 조합론, 기하
정답자
아직 제출이 없습니다

문제

Micchan noticed that an umbrella is a regular polygon when looking from above. So, she created the following problem.

Umbrella Query

A regular NN polygon has NN edges and N(N−1)2−N\frac{N(N-1)}{2} - N diagonals. Consider the union of them, which includes N(N−1)2\frac{N(N-1)}{2} line segments.

How many pairs of line segments satisfy the following 22 conditions?

  • The 22line segments have a common endpoint. In other words, they have a common point at one of the vertices of the regular NN polygon.
  • The 22 line segments are perpendicular.

Micchan has given TT of the above problems. However, her friend cannot solve too many requests. Answer each problem on her behalf.

입력

TT

N_1N\_1

N_2N\_2

⋮\vdots

N_TN\_T

출력

Output the answer in TT lines. On the ii-th line, output the answer to the problem when N=N_iN = N\_i. Add a new line at the end of each line.

제한

  • All inputs consist of integers.
  • 1≤T≤1051 \le T \le 10^5
  • 3≤N_i≤1093 \le N\_i \le 10^9

힌트

In Sample Input 1, you count only pairs of line segments that intersect perpendicularly at the vertices of the square.

예제1

  1. 예제 1

    입력
    3
    4
    3
    1000000000
    
    예상 출력
    4
    0
    499999999000000000