F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

An Easy Physics Problem

Time 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
2 0 0 1 2 2 0 1 -1 -1 0 0 1 -1 2 1 -1 1 2
 

Sample Output
Case #1: No Case #2: Yes
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-04 21:39:27, Gzip enabled