Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. int t;
  2. cin >> t;
  3. forn(_,t){
  4. int a,b,c,d;
  5. cin >> a>>b>>c>>d;
  6. int x,y,x1,x2,y1,y2;
  7. cin >>x>>y>>x1>>y1>>x2>>y2;
  8. bool nice = 1;
  9. int X1 = x-x1,X2=x2-x;
  10. int Y1=y-y1,Y2=y2-y;
  11. if(a-b>X1 || b-a > X2 || d-c>Y2 || c-d>Y1){
  12. nice = 0;
  13. }
  14. if(X1==0 && X2 == 0 && (a>0 || b>0) ){
  15. nice = 0;
  16. }
  17. else if(Y1==0 && Y2 == 0 && (c>0 || d>0) ){
  18. nice = 0;
  19. }
  20. /*if(a>=b && x-x1<a-b || a<b && x2-x <b-a){
  21. nice = 0;
  22. }
  23. if(d>=c && y2-y<d-c || d<c && y-y1 < c-d){
  24. nice = 0;
  25. }
  26. if(x==x1 && a>b || x==x2 && a<b || y == y1 && d>c || y==y2 && c>d ||
  27. (x == x1 && x == x2 && a+b>0) || (y==y1 && y == y2 && c+d>0)){
  28. nice =0;
  29. }*/
  30. if(nice){
  31. cout<<"YES"<<endl;
  32. }else{
  33. cout<<"NO"<<endl;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement