Олимпиадный тренинг

Задача 38592. Snow cover


Задача

Темы: Цикл for Циклы
In some village there are 999 towers 1, (1 + 2), (1 + 2 + 3), ..., (1 + 2 + 3 + ... + 999) meters high from west to east. The distance between two adjacent towers is 1 meter. It snowed for a while before it finally stopped. For two neighboring towers located 1 meter apart, we measured the lengths of the parts of these towers that are not covered with snow and got a meters for the west tower and b meters for the east tower. Assuming that the thickness of the snow cover and the height above sea level are the same in the entire settlement, find the total depth of the snow cover. Let's also assume that the depth of the snow cover is always at least 1 meter.

Input
The input string contains two integers a and b (\(1\leq a<b<499500=1+2+3+...+999\)) . All input data satisfies the condition of the problem.

Imprint
Print the depth of the snow cover.
 

 

Examples
# Input Output Explanation
1 8 13 2 The two towers are 10 meters and 15 meters respectively. Thus, we see that the depth of the snow cover is 2 meters.
2 54 65 1