#P9140. Keychains

Keychains

Source: Super League of Chinese College Students Algorithm Design 2022, Contest 2 by HDU.

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 33-dimensional space.

Two keychains are interlocked, if and only if we can't let their center's distance greater than 1011451410^{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 TT, indicating TT test cases. In each case:

First line is 7 integers x1,y1,z1,x2,y2,z2,rx_1,y_1,z_1,x_2,y_2,z_2, r, (x1,y1,z1)(x_1,y_1,z_1) indicates the coordinate of the center of the first circle, (x2,y2,z2)(x_2,y_2,z_2) indicates the normal vector of the plane of the first circle, rr indicates the radius of the first circle.

Second line is 7 integers x1,y1,z1,x2,y2,z2,rx'_1,y'_1,z'_1,x'_2,y'_2,z'_2, r', (x1,y1,z1)(x'_1,y'_1,z'_1) indicates the coordinate of the center of the second circle, (x2,y2,z2)(x'_2,y'_2,z'_2) indicates the normal vector of the plane of the second circle, rr' 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.10.1.

1T1000,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,$ 1r,r10001\le r,r' \le 1000.

Output

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

Sample

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