Logo
(追記) (追記ここまで)

30356번 - Umbrella Queries 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB72494078.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?

  • The 2ドル$line segments have a common endpoint. In other words, they have a common point at one of the vertices of the regular $N$ polygon.
  • The 2ドル$ line segments are perpendicular.

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.

제한

  • All inputs consist of integers.
  • 1ドル \le T \le 10^5$
  • 3ドル \le N_i \le 10^9$

예제 입력 1

3
4
3
1000000000

예제 출력 1

4
0
499999999000000000

힌트

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

출처

Contest > ICPC Japanese Alumni Group > JAG Summer Camp > JAG Summer Camp 2023 Day 2 C번

Camp > Petrozavodsk Programming Camp > Summer 2024 > Day 1: Welcome Contest C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /