Rama is in love with geometry. So once he was playing with circles and rectangles. Given the center of circle and radius and also the co-ordinates of vertices of rectangle, he wants to check whether the rectangle lies inside the circle or not.

Note: If all the vertices are lie the circumference of circle then it should be considered to be inside.

Input:

First line will contain a positive integer t - number of test cases.
For each test case there will be 5 lines - first will contain three space separated integers radius r, x co-ordinate of center xc and y co-ordinate of circle yc . For next 4 lines there will be 2 space separated numbers each, first denoting the x co-ordinate of that vertex(Xi) and the y co-ordinate of that vertex(Yi) of the rectangle.

Output:

For each test case, output a single line containing “Yes” (without quotes) if the rectangle lies inside the circle, or “No” (without quotes) if it does not lie inside.

Constraints:

1 ≤ t ≤ 10^4
1 ≤ r ≤ 10^4
-10^4 ≤ xc , yc , Xi , Yi ≤ 10^4

SAMPLE INPUT
1
5 0 0
-3 2
2 2
2 -2
-3 -2

SAMPLE OUTPUT
Yes
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''

testcases = int(raw_input())
count = 0
for i in range(testcases):
	circ = raw_input().split()
	coor1 = raw_input().split()
	coor2 = raw_input().split()
	coor3 = raw_input().split()
	coor4 = raw_input().split()
	if((int(circ[1])-int(coor1[0]))**2+(int(circ[2])-int(coor1[1]))**2- int(circ[0])**2<=0 ):
		if((int(circ[1])-int(coor2[0]))**2+(int(circ[2])-int(coor2[1]))**2- int(circ[0])**2<=0 ):
			if((int(circ[1])-int(coor3[0]))**2+(int(circ[2])-int(coor3[1]))**2- int(circ[0])**2<=0):
				if((int(circ[1])-int(coor4[0]))**2+(int(circ[2])-int(coor4[1]))**2- int(circ[0])**2<=0):
					print "Yes"
				else:
					print "No"
			else:
				print "No"
		else:
			print "No"
			
	else:
		print "No"