QOJ.ac

QOJ

시간 제한: 1.0 s 메모리 제한: 32 MB 총점: 40

#17554. 交点

통계

考虑一个拥有 $N$ 个顶点的凸多边形,它满足一个额外的性质:任意三条对角线都不交于同一点。求该多边形中对角线两两相交的交点个数。

下图展示了一个拥有 6 个顶点的此类多边形。

注意:如果一个多边形的所有内角都小于 180 度,则称其为凸多边形。

输入格式

输入只有一行,包含一个整数 $N$($3 \le N \le 100$)。

输出格式

输出一行一个整数,表示交点的个数。

样例

输入 1

3

输出 1

0

输入 2

4

输出 2

1

输入 3

6

输出 3

15

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.