Initially, two non-touching spheres of radii R1 and R2 are lying in space at rest. Both of them are then given accelerations a1 and a2 respectively at time=0. Find whether they will ever come in contact. Their initial positions are represented as (x1,y1,z1) and (x2,y2,z2) respectively. Accelerations have respective components in 3D. They are represented as (a1i,a1j,a1k) and (a2i,a2j,a2k) respectively.
Input Format
The first line contains T, the number of test cases.
Each test case consists of five lines, where the first line contains R1 and R2. The next two lines contain position and acceleration of the first sphere. The next two lines after this contain position and acceleration of the second sphere. All numbers in input are integers.
Output Format
For each test case, print YES
, if the spheres come in contact. Otherwise, print NO
(quotes for clarity).
Constraints
1 ≤ T ≤ 104
1 ≤ R1, R2 ≤ 102
-102 ≤ x1, y1, z1 , x2 , y2 , z2 ≤ 102
-102 ≤ a1i , a1j , a1k , a2i , a2j , a2k ≤ 102
Sample input
2
1 2
0 0 0
-1 0 0
4 0 0
1 0 0
1 2
0 0 0
100 0 0
4 0 0
0 0 0
Sample output
NO
YES
Explanation
For first testcase, both spheres go in opposite directions, so they'll never come in contact.
For second testcase, second sphere is not moving while first sphere is accelerating towards the second sphere. So they come in contact.