B. Metro
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Svetozar does not go outside without a reason, of course. He has very important business in another district of the city. But how can he get there? Luckily, the city where Svetozar lives has a metro – and not an ordinary one, but one with a circular line!

The circular line consists of $$$n$$$ stations, numbered consecutively from $$$1$$$ to $$$n$$$ clockwise. Between any two neighboring stations there is a bidirectional segment: between stations $$$1$$$ and $$$2$$$, between $$$2$$$ and $$$3$$$, $$$\ldots$$$, between $$$n - 1$$$ and $$$n$$$, and also between $$$n$$$ and $$$1$$$. Trains can travel in both directions.

The fare for traveling along one segment between stations $$$u$$$ and $$$v$$$ depends on their numbers:

  • if $$$u$$$ and $$$v$$$ have different parity, the fare is $$$1$$$ coin;
  • if $$$u$$$ and $$$v$$$ have the same parity, the fare is $$$2$$$ coins.

Svetozar is at station $$$s$$$ and needs to get to station $$$f$$$ ($$$s \ne f$$$). Find the minimum cost of such a trip in coins, using only the circular metro line.

Input

The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$): the number of test cases. Then, $$$t$$$ test cases follow.

The only line of a test case contains integers $$$n$$$, $$$s$$$, and $$$f$$$ ($$$3 \leq n \leq 10^9$$$, $$$1 \leq s, f \leq n$$$, $$$s \ne f$$$): the number of stations on the line and the starting and ending stations of the trip.

Output

For each test case, print the minimum cost of the trip from station $$$s$$$ to station $$$f$$$ on a separate line.

Example
Input
8
5 1 5
6 1 6
5 1 4
6 1 4
3 1 2
3 3 1
6 2 3
67 60 7
Output
2
1
3
3
1
2
1
15
Note

In the first two test cases of the sample, it is cheapest to travel one station counterclockwise. Thus, the cost of the trip is $$$2$$$ coins in the first test case (because the station numbers have the same parity) and $$$1$$$ coin in the second test case (because the parities are different).

In the third test case, Svetozar should travel two stations counterclockwise for $$$2 + 1 = 3$$$ coins.