#abc099b. B - Stone Monument
B - Stone Monument
Score : points
问题陈述
在某个村庄中,从西向东有 座塔,高度分别为 米,每座塔之间的间隔为 米。
雪一直下到最终停止。对于相距 米的任意两座相邻的塔,我们测量了这两座塔未被雪覆盖的部分长度,结果是西边的塔高为 米,东边的塔高为 米。
假设整个村庄内雪的覆盖深度和海拔高度处处相同,请找出雪的覆盖厚度。
同时假设雪的覆盖深度至少为 米。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
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.
Constraints
- 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:
Output
If the depth of the snow cover is meters, print as an integer.
Sample Input 1
8 13
Sample Output 1
2
The heights of the two towers are meters and meters, respectively. Thus, we can see that the depth of the snow cover is meters.
Sample Input 2
54 65
Sample Output 2
1
update @ 2024/3/10 17:18:59
相关
在下列比赛中: