P28538 [洛谷] Diagonals
普及+
题目描述

Problem Description

For a convex polygon with $n$ vertices, no three diagonals intersect at a single point. Calculate the number of intersection points of the diagonals in the polygon.

For example, a hexagon:

Hexagon

Input Format

The input consists of a single integer $n$, representing the number of sides.

Output Format

Output a single integer representing the answer.

Sample Input and Output

Sample Input #1

3

Sample Output #1

0

Sample Input #2

6

Sample Output #2

15

Notes

Data Size and Constraints

  • For $50\%$ of the data, it is guaranteed that $3 \leq n \leq 100$.
  • For $100\%$ of the data, it is guaranteed that $3 \leq n \leq 10^5$.
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3
样例输出
0