AtCoder Beginner Contest 099
B
Stone Monument
AtCoder
⌀ 0
原题
← AC →
翻译中…

Problem Statement

翻译中…

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

翻译中…

It had been snowing for a while before it finally stopped. For some two adjacent towers located $1$ meter apart, we measured the lengths of the parts of those towers that are not covered with snow, and the results are $a$ meters for the west tower, and $b$ 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 $1$ meter.

翻译中…

Constraints

翻译中…
  • $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:

翻译中…

a b

翻译中…

Output

翻译中…

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

翻译中…

样例

Input #1
8 13
Output #1
2
The heights of the two towers are $10$ meters and $15$ meters, respectively. Thus, we can see that the depth of the snow cover is $2$ meters.
Input #2
54 65
Output #2
1
题目信息
题号
abc099_b
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。