#P7153. Keychains

    ID: 6010 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>2022“杭电杯”中国大学生算法设计超级联赛(2)

Keychains

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.

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