#C5251. Minimum Hours to Meet
Minimum Hours to Meet
Minimum Hours to Meet
Alice and Eve are waiting to meet along a circular route consisting of n stations numbered from 1 to n. They can move in either clockwise or counterclockwise direction from one station to an adjacent station in one hour.
The task is to determine the minimum number of hours required for them to meet at the same station. Specifically, if Alice starts at station a and Eve starts at station e, they can choose the direction that minimizes the travel time. In mathematical terms, the clockwise distance is computed by \( (e - a) \mod n \) and the counterclockwise distance by \( (a - e) \mod n \). The answer is the minimum of these two distances.
inputFormat
The input consists of a single line containing three integers separated by spaces: n (the total number of stations), a (Alice's starting station), and e (Eve's starting station).
outputFormat
Output one integer: the minimum number of hours required for Alice and Eve to meet at the same station.
## sample7 4 4
0