QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 512 MB Puntuación total: 100

#14450. Circular Line

Estadísticas

The public transportation system in the city where Little C lives is well-developed, with numerous subway lines. Today, Little C decided to take Subway Line 7 to visit Little Q. Subway Line 7 is a circular line—no matter which direction you take, you can reach any station on Line 7!

Specifically, there are $n$ stations on Line 7 ($n$ is odd), numbered $1, 2, \dots, n$. The circular line consists of two opposite loop routes: the first route operates in the direction $1 \to 2 \to 3 \to \dots \to n \to 1 \to \dots$, and the second route operates in the direction $1 \to n \to n - 1 \to \dots \to 2 \to 1 \to n \to \dots$. Assume that the distance between any two adjacent stations is the same, and the time required to travel from any station to the next station is also the same for both routes.

Now, Little C is at station $s$, and Little Q's home is at station $t$. Although Little C can reach Little Q's home regardless of which direction he takes, he still wants to arrive as quickly as possible. Can you help Little C determine which route he should take?

Input

The input contains three integers $n, s, t$ ($3 \le n \le 100$, $1 \le s, t \le n$, $s \neq t$, $n$ is odd), representing the number of stations on the circular line, the station number where Little C is located, and the station number where Little Q's home is located, respectively.

Output

Output an integer $x$ ($x \in \{1, 2\}$), representing the route number Little C should take under the optimal strategy.

Examples

Input 1

3 1 2

Output 1

1

Input 2

3 1 3

Output 2

2

Input 3

3 3 1

Output 3

1

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.