Advertisement
raisul82

LIGHTOJ 1107 - How Cow

Jul 24th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int x1,y1,x2,y2,M,t,l=0;
  6. scanf("%d",&t);
  7. while(t-- && scanf("%d%d%d%d%d",&x1,&y1,&x2,&y2,&M)==5)
  8. {
  9. int p1[M],p2[M],res[M];
  10. for(int i=0; i<M; i++)
  11. {
  12. scanf("%d%d",&p1[i],&p2[i]);
  13. if(p1[i]>x1 && p1[i]<x2 && p2[i]>y1 && p2[i]<y2)
  14. {
  15. res[i]=1;
  16. }
  17. else
  18. {
  19. res[i]=0;
  20. }
  21. }
  22. printf("Case %d:\n",++l);
  23. for(int i=0; i<M; i++)
  24. {
  25. if(res[i]==1)
  26. {
  27. printf("Yes\n");
  28. }
  29. else
  30. {
  31. printf("No\n");
  32. }
  33.  
  34. }
  35.  
  36. }
  37.  
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement