#abc305a. A - Water Station
A - Water Station
Score : points
问题陈述
存在一场全程为 的超级马拉松比赛。在赛道沿途每 处,包括起点和终点,设置了共计 个补给站。
Takahashi 正位于该赛道的第 点处。请找出距离他最近的补给站的位置。
根据本问题的约束条件,可以证明最近的补给站是唯一确定的。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There is an ultramarathon course totaling . Water stations are set up every along the course, including the start and goal, for a total of .
Takahashi is at the point of this course. Find the position of the nearest water station to him.
Under the constraints of this problem, it can be proven that the nearest water station is uniquely determined.
Constraints
- is an integer.
Input
The input is given from Standard Input in the following format:
Output
Print the distance between the start and the water station nearest to Takahashi, in kilometers, in a single line.
Sample Input 1
53
Sample Output 1
55
Takahashi is at the point of the course. The water station at the point is away, and there is no closer water station. Therefore, you should print .
Sample Input 2
21
Sample Output 2
20
Takahashi could also go back the way.
Sample Input 3
100
Sample Output 3
100
There are also water stations at the start and goal. Additionally, Takahashi may already be at a water station.
update @ 2024/3/10 08:35:34