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

Keychains

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 540    Accepted Submission(s): 156


Problem Description
Kayzin is a magician. During a performance one day, he took out two keychains and covered them with a cup. He claimed that when the cup were lifted, the two keychains would be interlocked. But because of the poor lighting, the audience can't see clearly, so the audience wants you to figure out whether the two keychains are interlocked. If yes, please print "Yes", otherwise print "No".

A keychain can be described as a circle in 3-dimensional space.

Two keychains are interlocked, if and only if we can't let their center's distance greater than $10^{114514}$ by moving two keychains without collision.

For the first sample, two keychains are as follows, they are interlocked obviously.


 

Input
First line is one integer $T$, indicating $T$ test cases. In each case:

First line is 7 integers $x_1,y_1,z_1,x_2,y_2,z_2, r$, $(x_1,y_1,z_1)$ indicates the coordinate of the center of the first circle, $(x_2,y_2,z_2)$ indicates the normal vector of the plane of the first circle, $r$ indicates the radius of the first circle.

Second line is 7 integers $x'_1,y'_1,z'_1,x'_2,y'_2,z'_2, r'$, $(x'_1,y'_1,z'_1)$ indicates the coordinate of the center of the second circle, $(x'_2,y'_2,z'_2)$ indicates the normal vector of the plane of the second circle, $r'$ indicates the radius of the second circle.

It is guaranteed that the distance between any two points on two circles is not less than 0.1.

$1\le T \le 1000,$ $-1000\le x_1,y_1,z_1,x_2,y_2,z_2,x'_1,y'_1,z'_1,x'_2,y'_2,z'_2\le 1000,$ $1\le r,r' \le 1000$
 

Output
For each test case, print one line, "Yes" or "No", indicating answer.
 

Sample Input
2 0 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 1 0 0 0 1 10
 

Sample Output
Yes No
 

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-12 09:42:47, Gzip enabled