Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int t;
- cin >> t;
- forn(_,t){
- int a,b,c,d;
- cin >> a>>b>>c>>d;
- int x,y,x1,x2,y1,y2;
- cin >>x>>y>>x1>>y1>>x2>>y2;
- bool nice = 1;
- int X1 = x-x1,X2=x2-x;
- int Y1=y-y1,Y2=y2-y;
- if(a-b>X1 || b-a > X2 || d-c>Y2 || c-d>Y1){
- nice = 0;
- }
- if(X1==0 && X2 == 0 && (a>0 || b>0) ){
- nice = 0;
- }
- else if(Y1==0 && Y2 == 0 && (c>0 || d>0) ){
- nice = 0;
- }
- /*if(a>=b && x-x1<a-b || a<b && x2-x <b-a){
- nice = 0;
- }
- if(d>=c && y2-y<d-c || d<c && y-y1 < c-d){
- nice = 0;
- }
- if(x==x1 && a>b || x==x2 && a<b || y == y1 && d>c || y==y2 && c>d ||
- (x == x1 && x == x2 && a+b>0) || (y==y1 && y == y2 && c+d>0)){
- nice =0;
- }*/
- if(nice){
- cout<<"YES"<<endl;
- }else{
- cout<<"NO"<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement