EasyRating 800
Gauss Sum
Print 1 + 2 + ... + n for a very large n. A loop is too slow; use the formula.
Input
One integer n (1 ≤ n ≤ 10¹⁸).
Output
The sum.
Sample 1
Input
10
Output
55
Sample 2
Input
1
Output
1
Output appears hereOne integer n (1 ≤ n ≤ 10¹⁸).
The sum.
10
55
1
1
Output appears here