atcoder#ABC305A. [ABC305A] Water Station
[ABC305A] Water Station
Score : points
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.
53
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 .
21
20
Takahashi could also go back the way.
100
100
There are also water stations at the start and goal. Additionally, Takahashi may already be at a water station.