#B2072. Minimum Number of Apples

    ID: 11154 Type: Default 1000ms 256MiB

Minimum Number of Apples

Minimum Number of Apples

You are given a task of distributing a pile of apples among \(n\) children in such a way that each child receives at least one apple and no two children receive the same number of apples. Determine the minimum number of apples required for this distribution.

It can be observed that the optimal distribution is to give \(1, 2, 3, \ldots, n\) apples respectively, so that the minimum sum is given by \(\frac{n(n+1)}{2}\).

inputFormat

The input consists of a single integer \(n\) denoting the number of children.

outputFormat

Output the minimum number of apples required, which is calculated as \(\frac{n(n+1)}{2}\).

sample

1
1