100 atcoder#ABC099B. [ABC099B] Stone Monument

[ABC099B] Stone Monument

Score : 200200 points

Problem Statement

In some village, there are 999999 towers that are 1,(1+2),(1+2+3),...,(1+2+3+...+999)1,(1+2),(1+2+3),...,(1+2+3+...+999) meters high from west to east, at intervals of 11 meter.

It had been snowing for a while before it finally stopped. For some two adjacent towers located 11 meter apart, we measured the lengths of the parts of those towers that are not covered with snow, and the results are aa meters for the west tower, and bb meters for the east tower.

Assuming that the depth of snow cover and the altitude are the same everywhere in the village, find the amount of the snow cover.

Assume also that the depth of the snow cover is always at least 11 meter.

Constraints

  • 1a<b<499500(=1+2+3+...+999)1 \leq a < b < 499500(=1+2+3+...+999)
  • All values in input are integers.
  • There is no input that contradicts the assumption.

Input

Input is given from Standard Input in the following format:

aa bb

Output

If the depth of the snow cover is xx meters, print xx as an integer.

8 13
2

The heights of the two towers are 1010 meters and 1515 meters, respectively. Thus, we can see that the depth of the snow cover is 22 meters.

54 65
1