Time Limit: 15000/15000 MS (Java/Others)

Memory Limit: 512000/512000 K (Java/Others)

Matt is playing a naive computer game with his deeply loved pure girl.

The playground is a rectangle with walls around. Two balls are put in different positions inside the rectangle. The balls are so tiny that their volume can be ignored. Initially, two balls will move with velocity (1, 1). When a ball collides with any side of the rectangle, it will rebound without loss of energy. The rebound follows the law of refiection (i.e. the angle at which the ball is incident on the wall equals the angle at which it is reflected).

After they choose the initial position, Matt wants you to tell him where will the two balls collide for the first time.

The playground is a rectangle with walls around. Two balls are put in different positions inside the rectangle. The balls are so tiny that their volume can be ignored. Initially, two balls will move with velocity (1, 1). When a ball collides with any side of the rectangle, it will rebound without loss of energy. The rebound follows the law of refiection (i.e. the angle at which the ball is incident on the wall equals the angle at which it is reflected).

After they choose the initial position, Matt wants you to tell him where will the two balls collide for the first time.

The first line contains only one integer T which indicates the number of test cases.

For each test case, the first line contains two integers x and y. The four vertices of the rectangle are (0, 0), (x, 0), (0, y) and (x, y). (1 ≤ x, y ≤ 10^{5})

The next line contains four integers x_{1}, y_{1}, x_{2}, y_{2}. The initial position of the two balls is (x_{1}, y_{1}) and (x_{2}, y_{2}). (0 ≤ x_{1}, x_{2} ≤ x; 0 ≤ y_{1}, y_{2} ≤ y)

For each test case, the first line contains two integers x and y. The four vertices of the rectangle are (0, 0), (x, 0), (0, y) and (x, y). (1 ≤ x, y ≤ 10

The next line contains four integers x

For each test case, output “Case #x:” in the first line, where x is the case number (starting from 1).

In the second line, output “Collision will not happen.” (without quotes) if the collision will never happen. Otherwise, output two real numbers x_{c} and y_{c}, rounded to one decimal place, which indicate the position where the two balls will first collide.

In the second line, output “Collision will not happen.” (without quotes) if the collision will never happen. Otherwise, output two real numbers x

Case #1: 6.0 6.0 Case #2: Collision will not happen. Case #3: 6.0 5.0In first example, two balls move from (1, 1) and (9, 9) both with velocity (1, 1), the ball starts from (9, 9) will rebound at point (10, 10) then move with velocity (−1, −1). The two balls will meet each other at (6, 6).Hint

提交代码