P2181 Diagonals
Description
For an $n$-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 $6$-gon:

Input Format
The input contains a single line with an integer $n$, the number of sides.
Output Format
Output a single integer on one line: the answer.
Explanation/Hint
Constraints
- For $50 \%$ of the testdata, it is guaranteed that $3 \leq n \leq 100$.
- For $100 \%$ of the testdata, it is guaranteed that $3 \leq n \leq 10^5$.
Translated by ChatGPT 5