#P5073. Return to the Past

    ID: 18311 Type: Default 1000ms 256MiB

Return to the Past

Return to the Past

In order to relive the glory of past battles and fulfill a solemn promise, you need to harness the energy accumulated over time. Legend says that this energy is given by the sum of the first T positive integers. Your task is to compute this magical number.

The energy is defined by the formula: $$ S = \frac{T \times (T+1)}{2} $$

inputFormat

The input consists of a single integer T (1 ≤ T ≤ 109), representing the number of time units or battles.

outputFormat

Output a single integer: the computed sum S using the formula above.

sample

1
1