A Sum Problem
This is a sample problem to demonstrate the runtimes of different solutions with different time complexities.
Calculate the sum of integers in the range \([1, N]\).
The first line of the input will contain an integer \(N\) \((1 \le N \le 10^9)\).
Output the sum of integers in the range \([1, N]\). For C++ and Java users make sure you use
long long or
long to prevent integer overflow.
The sum is \(1 + 2 + 3 + 4 = 10\).