Umbrella Queries
시간 제한2초메모리 제한1024 MB
정N각형의 변과 대각선 중 한 꼭짓점을 공유하며 직각으로 만나는 두 선분의 쌍을 N마다 세는 문제이다.
문제
Micchan noticed that an umbrella is a regular polygon when looking from above. So, she created the following problem.
Umbrella Query
A regular polygon has edges and diagonals. Consider the union of them, which includes line segments.
How many pairs of line segments satisfy the following conditions?
- The line segments have a common endpoint. In other words, they have a common point at one of the vertices of the regular polygon.
- The line segments are perpendicular.
Micchan has given of the above problems. However, her friend cannot solve too many requests. Answer each problem on her behalf.
입력
출력
Output the answer in lines. On the -th line, output the answer to the problem when . Add a new line at the end of each line.
제한
- All inputs consist of integers.
힌트
In Sample Input 1, you count only pairs of line segments that intersect perpendicularly at the vertices of the square.