#pragma GCC optimize(2)#include<iostream>#include<algorithm>#include<cmath>#include<cstring>#include<stack>#include<map>#include<queue>#include<cstdio>#include<set>#include<map>#include<string>usingnamespace std;constint maxn =2e5+10;int a[maxn];voidsolve(){int t;
cin >> t;while(t--){int a, b, c, d;
cin >> a >> b >> c >> d;int x, y, x1, y1, x2, y2;
cin >> x >> y >> x1 >> y1 >> x2 >> y2;bool ok =0;int m, n;
m = b - a;
n = d - c;if(x2 == x1 &&(a >=1|| b >=1)) ok =0;elseif(y2 == y1 &&(c >=1|| d >=1)) ok =0;else{
x += m, y += n;if(x >= x1 && x <= x2 && y >= y1 && y <= y2) ok =1;else ok =0;}
cout <<(ok ?"Yes":"No")<< endl;}}intmain(){//freopen("Testin.txt", "r", stdin);solve();return0;}