Advertisement
Saleh127

Untitled

Apr 6th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. long long int a,b,c,d,e,u,v,x1,x2,x,y,y1,y2;
  6. cin>>e;
  7. while(e--)
  8. {
  9. cin>>a>>b>>c>>d;
  10. cin>>x>>y>>x1>>y1>>x2>>y2;
  11. u=b-a+x;
  12. v=d-c+y;
  13. if((x1==x2 && a==b &&a!=0)||(y1==y2 && d==c && c!=0))
  14. {
  15. cout<<"NO\n";
  16. }
  17. else if(x1<=u && u<=x2 && y1<=v && v<=y2)
  18. {
  19. cout<<"YES\n";
  20. }
  21. else
  22. {
  23. cout<<"NO\n";
  24. }
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement