#P2181. 对角线

对角线

Description

For an nn-vertex convex polygon in which no three diagonals intersect at a single point, find the number of intersection points among its diagonals.

For example, a 66-gon:

Input Format

The input contains a single line with an integer nn, the number of sides.

Output Format

Output a single integer on one line: the answer.

3
0
6
15

Hint

Constraints

  • For 50%50 \% of the testdata, it is guaranteed that 3n1003 \leq n \leq 100.
  • For 100%100 \% of the testdata, it is guaranteed that 3n1053 \leq n \leq 10^5.

Translated by ChatGPT 5