QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 1024 MB Puntuación total: 100

#10015. 计数正交对

Estadísticas

一个具有 $n$ 个顶点的正多边形有 $n$ 条边和 $\frac{n(n-1)}{2} - n$ 条对角线。考虑所有这些线段组成的集合,该集合总共包含 $\frac{n(n-1)}{2}$ 条线段。

计算该集合中有多少对线段满足以下条件: 这两条线段有一个公共端点(即正多边形的一个顶点), 这两条线段互相垂直。

输入格式

第一行包含一个整数 $t$:测试用例的数量($3 \le t \le 10^5$)。 接下来的 $t$ 行,每行包含一个整数 $n$:正多边形的顶点数($3 \le n \le 10^9$)。

输出格式

对于每个测试用例,在单独的一行中输出答案。

样例

输入 1

3
5
4
10836006

输出 1

0
4
58709502180012

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.