Triangles in the polygon
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Rain in an oak forest. 1891. Motives for genre painting, introduced into the landscape, it is extremely rare for Shishkina, though this technique has greatly contributed to the success of paintings from the general public. But the true value of this work is perfectly expressed by the state of nature: starting small, drizzling rain, wet, slippery trails, the gray-watery air.
In the convex n - gon take all the diagonals, no three of which pass through one point. How many different triangles formed?
Input
Each line is a separate test and contains a positive integer n (2 < n ≤ 1000).
Output
For each test on a separate line to derive the number of different triangles which are obtained after all the diagonals.
Examples
Input #1
Answer #1
Submissions 400
Acceptance rate 44%