#P5572. An Easy Physics Problem
An Easy Physics Problem
Problem Description
On an infinite smooth table, there's a big round fixed cylinder and a little ball whose volume can be ignored.
Currently the ball stands still at point $A$, then we'll give it an initial speed and a direction. If the ball hits the cylinder, it will bounce back with no energy losses.
We're just curious about whether the ball will pass point $B$ after some time.
Input
First line contains an integer $T$, which indicates the number of test cases.
Every test case contains three lines.
The first line contains three integers $O_x$, $O_y$ and $r$, indicating the center of cylinder is $(O_x, O_y)$ and its radius is $r$.
The second line contains four integers $A_x$, $A_y$, $V_x$ and $V_y$, indicating the coordinate of $A$ is $(A_x, A_y)$ and the initial direction vector is $(V_x, V_y)$.
The last line contains two integers $B_x$ and $B_y$, indicating the coordinate of point $B$ is $(B_x, B_y)$.
$\cdot$ 1 ≤ $T$ ≤ 100.
$\cdot$ |$O_x$|,|$O_y$|≤ 1000.
$\cdot$ 1 ≤ $r$ ≤ 100.
$\cdot$ |$A_x$|,|$A_y$|,|$B_x$|,|$B_y$|≤ 1000.
$\cdot$ |$V_x$|,|$V_y$|≤ 1000.
$\cdot$ $V_x \neq 0$ or $V_y \neq 0$.
$\cdot$ both A and B are outside of the cylinder and they are not at same position.
Output
For every test case, you should output "Case #x: y", where $x$ indicates the case number and counts from $1$. $y$ is "Yes" if the ball will pass point $B$ after some time, otherwise $y$ is "No".
2
0 0 1
2 2 0 1
-1 -1
0 0 1
-1 2 1 -1
1 2
Case #1: No
Case #2: Yes