8489: Keychains

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

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
by moving two keychains without collision.
For the first sample, two keychains are as follows, they are interlocked obviously.


    

输入格式

First line is one integer , indicating test cases. In each case:
First line is 7 integers , indicates the coordinate of the center of
the first circle, indicates the normal vector of the plane of the first circle, indicates the
radius of the first circle.
Second line is 7 integers , indicates the coordinate of the center
of the second circle, indicates the normal vector of the plane of the second circle,
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<=T<=1000 , -1000<=X,Y,Z<=1000,1<=r<=1000

输出格式

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

输入样例 复制

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

输出样例 复制

Yes
No