~/algor $ cat problems/birdan-n-gacha-yigindi
Sum from 1 to n
Easy
1000 ms
64 MB
8%
A positive integer $n$ is given. Find the sum of all positive integers from $1$ to $n$:
$$1 + 2 + \ldots + n$$
Input
One positive integer $n$.
Output
One integer — the sum.
Note
$1 \le n \le 10^{9}$
Examples
Input #1
5
Output #1
15
Input #2
1
Output #2
1