shipu_a

Div 1 Problem H

Jan 15th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include<cstdio>
  2. #include<cmath>
  3. int main()
  4. {
  5.     double x1,x2,y1,y2,x,y,r,d;
  6.     int test,q;
  7.     scanf("%d",&test);
  8.     while(test--)
  9.     {
  10.         scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
  11.         r=sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)));
  12.         scanf("%d",&q);
  13.         while(q--)
  14.         {
  15.             scanf("%lf%lf",&x,&y);
  16.             d=sqrt(((x1-x)*(x1-x))+((y1-y)*(y1-y)));
  17.             if(d<=r)
  18.                 printf("Yes\n");
  19.             else
  20.                 printf("No\n");
  21.         }
  22.     }
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment