#include <bits/stdc++.h>
using namespace std;
const int N=10+20;
struct airport
{
int t,d,l;
}p[N];
bool re[N];
int n;
bool DFS(int u,int time){
if(u>=n)
return true;
for(int i=0;i<n;i++){
if(!re[i]){
re[i]=true;
if(time>(p[i].t+p[i].d))
{
re[i]=false;
return false;
}
int t=max(time,p[i].t)+p[i].l;
if(DFS(u+1,t))
return true;
re[i]=false;
}
}
return false;
}
void solve()
{
cin>>n;
for(int i=0;i<n;i++){
cin>>p[i].t>>p[i].d>>p[i].l;
}
if(DFS(0,0))
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
int main(){
int T;
cin>>T;
while (T--)
{
solve();
}
}