#include using namespace std; #define rep(i,a,b) for (int i = a; i < b; i++) #define trav(a,b) for (auto a : b) #define all(x) begin(x),end(x) #define lld long long void Solve() { int n; cin>>n; vector > >V; rep(i,0,n){ lld x,y; cin>>x>>y; V.push_back({x+y,{x,y}}); } sort(V.begin(),V.end()); reverse(V.begin(),V.end()); lld last=3e9+1; lld tot=0; vector T; trav(a,V){ //cout<a.first && tot>0){ if(tot%2==1){ T.push_back(last); } tot/=2; last--; } last=a.first; tot++; //cout<=-10 && tot>0){ if(tot%2==1){ T.push_back(last); } tot/=2; last--; } trav(a,T){ if(a<-1){ cout<<"NO\n"; return; } } int ans=0; trav(a,T){ if(a==-1)ans+=2; if(a==0)ans++; } if(ans>=3){ cout<<"NO\n"; return; } cout<<"YES\n"; } signed main() { ios::sync_with_stdio(0); cin.tie(0); int tt = 1; cin >> tt; while (tt--) Solve(); return 0; }