#堀江
def f(x,y,r)
if x*x+y*y<r*r then
return 1
else
return 0
end
end
l1=gets.split(" ")
n=l1[0].to_i
x,y,r,t=l1.map{|e| e.to_f}[1,4]
t1=-t/180*Math::PI
cos1=Math.cos(t1)
sin1=Math.sin(t1)
n.times{
px1,py1,px2,py2=gets.split(" ").map{|e| e.to_f}
px1-=x
py1-=y
px2-=x
py2-=y
c1=f(px1,py1,r)+f(px2,py2,r)
ans="No"
py1r=px1*sin1+py1*cos1
py2r=px2*sin1+py2*cos1
if c1==0 then
ans="No"
elsif c1==2 then
ans="Yes" if 0.0<=py1r || 0.0<=py2r
else
ans="Yes" if f(px1,py1,r)==1 && 0.0<=py1r
ans="Yes" if f(px2,py2,r)==1 && 0.0<=py2r
end
puts ans
}
I+WggOaxnyAKZGVmIGYoeCx5LHIpCglpZiB4KngreSp5PHIqciB0aGVuCgkJcmV0dXJuIDEKCWVsc2UKCQlyZXR1cm4gMAoJZW5kCmVuZAoKbDE9Z2V0cy5zcGxpdCgiICIpCm49bDFbMF0udG9faQp4LHkscix0PWwxLm1hcHt8ZXwgZS50b19mfVsxLDRdCgoKdDE9LXQvMTgwKk1hdGg6OlBJCmNvczE9TWF0aC5jb3ModDEpCnNpbjE9TWF0aC5zaW4odDEpCm4udGltZXN7CglweDEscHkxLHB4MixweTI9Z2V0cy5zcGxpdCgiICIpLm1hcHt8ZXwgZS50b19mfQoJcHgxLT14CglweTEtPXkKCXB4Mi09eAoJcHkyLT15CgljMT1mKHB4MSxweTEscikrZihweDIscHkyLHIpCglhbnM9Ik5vIgoJcHkxcj1weDEqc2luMStweTEqY29zMQoJcHkycj1weDIqc2luMStweTIqY29zMQoJCglpZiBjMT09MCB0aGVuCgkJYW5zPSJObyIKCWVsc2lmIGMxPT0yIHRoZW4KCQlhbnM9IlllcyIgaWYgMC4wPD1weTFyIHx8IDAuMDw9cHkycgoJZWxzZQoJCWFucz0iWWVzIiBpZiBmKHB4MSxweTEscik9PTEgJiYgMC4wPD1weTFyCgkJ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