|
||||||||||
An Easy Physics ProblemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 6534 Accepted Submission(s): 1358 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". Sample Input
Sample Output
Source | ||||||||||
|