Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstdio>
- #include<cmath>
- int main()
- {
- double x1,x2,y1,y2,x,y,r,d;
- int test,q;
- scanf("%d",&test);
- while(test--)
- {
- scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
- r=sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)));
- scanf("%d",&q);
- while(q--)
- {
- scanf("%lf%lf",&x,&y);
- d=sqrt(((x1-x)*(x1-x))+((y1-y)*(y1-y)));
- if(d<=r)
- printf("Yes\n");
- else
- printf("No\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment