I I U P C   2 0 1 4

Problem H: Perfect Flag

 

The national flag of Bangladesh is bottle green in color and rectangular in size with the length (L) to width ratio of 10:6. It bears a red circle on the background of green. It maintains the length (L) to radius ratio of 5:1 (If the length is 10 then width should be 6 and radius should be 2). The color in the background represents the greenery of Bangladesh while the red circle symbolizes the rising sun and the sacrifice of lives in our freedom fight.

Its centre will be placed on the intersecting point of the perpendicular drawn from the nine-twentieth part of the length of the flag, and the horizontal line drawn through the middle of its width.

 

 

                   

 

 

Input

First line of input will contain the number of test cases, T ≤ 100. Then there follows T lines, each containing seven positive integer x0, y0, x1, y1, cx, cy, r 1000. Here,
(x0,y0) is the lower left corner of the rectangle

(x1,y1) is the upper right corner of the rectangle

(cx,cy) is the center of the circle and r is the radius.

 

 

Output

For each test case if the given data represents a valid flag design print ‘YES’ else print ‘NO’.

 

Sample Input

Output for Sample Input

4

0 0 20 12 9 6 4

0 0 10 6 4 3 2

1 1 21 13 10 7 4
0 0 20 20 9 10 4

YES

NO
YES
NO

 

Note: Pi is considered to be acos( -1 ).

 

Problem Setter: Kaysar Abdullah