logo AlgoBeat OnlineJudge
登录 注册

#215764. [JAG 2023 Summer Camp #2] Umbrella Queries

内存限制:1024 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 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 polygon.
  • The 2 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.

输入格式

The input satisfies the following constraints.

  • All inputs consist of integers.

输出格式

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.

样例

样例输入 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.