#P5377. Maximum Cake Pieces

    ID: 18610 Type: Default 1000ms 256MiB

Maximum Cake Pieces

Maximum Cake Pieces

Given a circular cake, n distinct points are selected on its circumference. Every pair of these points is connected with a straight line. These lines divide the cake into several regions. Under the condition that no three lines are concurrent at an interior point, determine the maximum number of pieces the cake can be divided into.

The answer can be expressed using the formula in \( \LaTeX \):

\[ R(n) = 1 + \binom{n}{2} + \binom{n}{4} = 1 + \frac{n(n-1)}{2} + \frac{n(n-1)(n-2)(n-3)}{24} \]

inputFormat

The input consists of a single integer n (n ≥ 1), representing the number of points on the circumference of the cake.

outputFormat

Output a single integer, the maximum number of pieces the cake can be divided into.

sample

1
1

</p>