By Caio Russi, UNOESTE Brazil
One natural number is a non-negative integer (0, 1, 2, 3, 4, 5,...). Your task in this problem is to calculate the sum of the natural numbers that are present in a given interval [A, B] including.
For instance, the sum of the natural numbers in the range [2, 5] is 14 = (2 + 3 + 4 + 5).
The test case contains two integers A e B (1 ≤ A ≤ B ≤ 109), representing the lower limit and the upper respectively.
For each test, the output consists of one line containing the sum of natural numbers in the range.
Input Sample | Output Sample |
1 5 |
15 |
1 1000 | 500500 |
10 20 | 165 |