Polygon Diagonals
How many diagonals does a convex polygon with N vertices have?
Input: one integer N.
Output: N(N−3)/2.
Constraints:
- 3 ≤ N ≤ 109
Sample Tests
Input 1
5
Output 1
5
Input 2
3
Output 2
0
Discussion (opens after you solve — no spoilers before)
No comments yet.