#include<bits/stdc++.h>
using namespace std;
namespace fastio
{
constexpr int S1=1<<20;
char buf1[S1],*l1,*r1;
inline char getc()
{
return ((l1==r1&&(r1=(l1=buf1)+fread(buf1,1,S1,stdin)),l1!=r1)?*l1++:EOF);
}
template<typename T=int>inline T read()
{
T x=0,y=1;
char c=getc();
for(;c<'0'||c>'9';c=getc())
if(c=='-')
y=-1;
for(;c>='0'&&c<='9';c=getc())
x=c-'0'+x*10;
return x*y;
}
constexpr int S2=1<<20;
char buf2[S2],*l2=buf2;
inline void putc(char c)
{
l2==buf2+S2&&(fwrite(buf2,1,S2,stdout),l2=buf2),*l2++=c;
}
int st[42];
template<typename T>inline void write(T x,char end='\n')
{
if(x<0)
putc('-'),x=-x;
int tp=0;
do
st[++tp]=x%10;
while(x/=10);
while(tp)
putc(st[tp--]+'0');
if(end)
putc(end);
}
inline void ps(const char*s,char end='\n')
{
for(auto p=s;*p;p++)
putc(*p);
if(end)
putc(end);
}
struct end
{
~end()
{
fwrite(buf2,1,l2-buf2,stdout);
}
}ender;
}
using fastio::getc;
using fastio::read;
using fastio::putc;
using fastio::write;
using fastio::ps;
constexpr int MN=200005,inf=0x3f3f3f3f;
int n,p[MN];
long long s;
struct node
{
long long a,b,t;
}a[MN];
map<int,long long>mp;
inline long long sum(map<int,long long>::iterator R)
{
long long a=R->second,t=next(R)->first-R->first;
return (a+a+t-1)*t/2;
}
inline void mov(int x)
{
auto it=--mp.upper_bound(x);
long long p=it->second+x-it->first;
if(p==a[x].b)
return;
if(p<a[x].b)
{
if(x!=it->first)
it=mp.emplace(x,p).first;
map<int,long long>::iterator R;
for(R=it;R->first-x+a[x].b>=R->second;R++)
s-=sum(R);
mp.erase(it,R);
it=mp.emplace(x,a[x].b).first;
s+=sum(it);
}
else
{
if(x!=next(it)->first-1)
mp[x+1]=p+1;
map<int,long long>::iterator L;
for(L=it;a[x].b-(x-L->first)<=L->second;L--)
s+=sum(L);
L++;
int px=L->first;
long long py=a[x].b-(x-px);
mp.erase(L,next(it));
it=mp.emplace(px,py).first;
s-=sum(it);
}
}
inline void work()
{
n=read();
for(int i=1;i<=n;i++)
a[i].a=read(),a[i].b=read(),a[i].t=read<long long>(),p[i]=i;
sort(p+1,p+n+1,[](int x,int y){
return a[x].t<a[y].t;
});
mp[0]=-inf,mp[n+1]=inf;
for(int i=1;i<=n;)
{
mp[i]=a[i].a;
int j;
for(j=i+1;j<=n&&a[j].a==a[j-1].a+1;j++);
i=j;
}
for(int I=1;I<=n;I++)
{
int x=p[I];
mov(x);
if(s>a[x].t)
{
puts("No");
return;
}
}
puts("Yes");
}
inline void clr()
{
s=0;
mp.clear();
}
int main()
{
freopen("move.in","r",stdin);
freopen("move.out","w",stdout);
read();
int T=read();
while(T--)
work(),clr();
return 0;
}