cho.sh
Notes
Loading...

Sum of Consecutive Integers

Time limit

0.25s

Memory limit

128 MB

Problem

Given two integers A and B, compute the sum of every integer between them, including both endpoints. A may be greater than B; in that case, still sum every integer in the closed interval between the two values.

Input

The first line contains two integers A and B separated by a space.

  • -2,147,483,648 ≤ A, B ≤ 2,147,483,647

Output

Print the sum of every integer between A and B on the first line. The output value is guaranteed to be between -2,147,483,648 and 2,147,483,647, inclusive.