#Q218. 「一本通 6.4 练习 2」五指山
「一本通 6.4 练习 2」五指山
Description
Original problem from: NEFU 84
The Great Sage is within the Buddha's palm.
We assume the Buddha's palm is a circle with a circumference of , labeled counterclockwise as: . The Great Sage can fly a distance of each time. The Great Sage's current position is denoted as , and the destination is . Your task is to determine the minimum number of flights required for the Great Sage to reach the destination.
Input Format
There are multiple test cases.
The first line contains a positive integer , indicating the number of test cases.
Each test case consists of a single line with four non-negative integers: the circumference of the Buddha's palm , the flight distance , the initial position , and the destination .
Note that the Great Sage's flight is always in the counterclockwise direction.
Output Format
For each test case, output a single line with the minimum number of flights required for the Great Sage to reach the destination. If it is impossible to reach the destination, output Impossible.
Sample 1
2
3 2 0 2
3 2 0 1
1
2
Constraints and Notes
For all test cases, .