cho.sh
Notes
Loading...

Easy Sequence Sum

Time limit

2s

Memory limit

128 MB

Problem

Consider the following sequence. The number 1 appears once, 2 appears twice, 3 appears three times, and in general each positive integer k appears exactly k consecutive times.

1 2 2 3 3 3 4 4 4 4 5 ...

Given an interval [A, B], compute the sum of the terms from the A-th term through the B-th term of this sequence.

Input

The first line contains two integers A and B, the start and end positions of the interval.

1 <= A <= B <= 1,000

Output

Print the sum of the terms in the interval.