#pragma region Header #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define ft first #define sc second #define X first #define Y second #define mp make_pair #define All(x) (x).begin(),(x).end() #define rAll(x) (x).rbegin(),(x).rend() typedef long long ll; typedef long double ld; using namespace std; ld PI = acos(-1); templateinline const T sqr(const T & x) { return x*x; } ll popcnt(ll mask) { ll cnt = 0; while (mask) cnt += mask & 1, mask >>= 1; return cnt; } ll powi(ll a, ll b, ll mod = 1000000007) { if (b < 2) return b ? a : 1; return (powi((a*a) % mod, b / 2, mod)*(b % 2 ? a : 1LL)) % mod; } ll mod7 = 1000000007; ll mod9 = 1000000009; bool isprime(ll n) { if (n < 2) return 0; for (ll i = 2; i*i <= n; i++) if (n%i == 0) return 0; return 1; } #pragma endregion int main() { #ifdef _DEBUG ifstream cin("input.txt"); #endif int q; cin >> q; while(q--) { int n,x,y; map> a; map> b; cin >> n; int mnx = 1e9; int mny = 1e9; int mxx = -1e9; int mxy = -1e9; vector> v; for(int i=0;i> x >> y; v.push_back({ x,y }); mnx = min(mnx, x); mny = min(mny, y); mxx = max(mxx, x); mxy = max(mxy, y); } bool flag = true; for(int i = 0;i