Skip to content

Sum 1..N

Unrated
English

Language

Contribute a translation
Time limit
1000 ms
Memory limit
256 MB
Submissions
0
Correct
0
Solved by
0
AC rate

Statement

Given $N$, print the sum $1 + 2 + \dots + N$.

Input

One integer $N$ ($1 \le N \le 10^9$).

Output

Print the sum. Use 64-bit arithmetic.

Examples

Sample input 1
3
Sample output 1
6

Notes

Subtask 1 (40 pts): $N \le 1000$. Subtask 2 (60 pts): $N \le 10^9$.

Tags

No tags yet