#ABC099B. Stone Monument
Stone Monument
题目描述
In some village, there are towers that are meters high from west to east, at intervals of meter.
It had been snowing for a while before it finally stopped. For some two adjacent towers located meter apart, we measured the lengths of the parts of those towers that are not covered with snow, and the results are meters for the west tower, and 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 meter.
在一些村庄里,有 座塔,从西向东高 米,每隔 米有一座。
雪下了好一会儿才停。对于相距 米的相邻两座塔,我们测量了这些塔未被雪覆盖部分的长度,结果是西塔为 米,东塔为 米。
假设村庄各处的积雪深度和海拔高度相同,求积雪量。
还假设积雪深度始终至少为 米。
输入格式
输入内容按以下格式标准输入:
输出格式
如果积雪深度为 米,则打印 个整数。
样例 #1
样例输入 #1
8 13
样例输出 #1
2
样例 #2
样例输入 #2
54 65
样例输出 #2
1
说明
数据规模与约定
- 所有输入值均为整数。
- 没有与假设相矛盾的输入。
样例 解释
样本输出 1
两座塔的高度分别为 米和 米。因此,我们可以看到积雪深度为 米。
相关
在以下作业中: