#include <bits/stdc++.h>
using namespace std;
#define int long long
#define File(x) freopen(x".in", "r", stdin), freopen(x".out", "w", stdout);
inline void debug() { cerr << '\n'; }
template<typename T, typename ...Args>
inline void debug(const T &x, const Args&... y) { cerr << x << ' ', debug(y...); }
#define DEBUG(x...) cerr << #x << " = ", debug(x)
typedef long long LL;
typedef pair<int, int> PII;
constexpr int N = 200010;
constexpr int INF = 0x3f3f3f3f;
template<typename Type>
inline void read(Type &res)
{
res = 0;
int ch = getchar(), flag = 0;
while (!isdigit(ch)) flag |= ch == '-', ch = getchar();
while (isdigit(ch)) res = (res << 3) + (res << 1) + (ch ^ 48), ch = getchar();
res = flag ? -res : res;
}
template<typename Type, typename... Args>
inline void read(Type &res, Args&... y) { read(res), read(y...); }
int c, T, n, p[N];
struct Box
{
int a, b, t;
Box(int _a = 0, int _b = 0, int _t = 0) : a(_a), b(_b), t(_t) {}
} box[N];
inline bool check(int pos, Box cur)
{
if (cur.a < cur.b) return cur.a <= pos && pos <= cur.b;
else return cur.b <= pos && pos <= cur.a;
}
inline bool in(int pos, Box cur, int border)
{
if (cur.a < cur.b) return cur.b < pos && pos <= border;
else return cur.b > pos && pos >= border;
}
namespace Pts44
{
void solve()
{
read(n);
for (int i = 1, a, b, t; i <= n; i ++)
read(a, b, t), box[i] = Box(a, b, t), p[i] = i;
sort(p + 1, p + 1 + n, [](const int &x, const int &y) { return box[x].t < box[y].t || (box[x].t == box[y].t && box[x].a < box[y].a); });
__int128 rest = 0;
for (int cur = 1; cur <= n; cur ++)
{
rest += box[p[cur]].t - box[p[cur - 1]].t;
if (abs(box[p[cur]].b - box[p[cur]].a) > (int)rest) return void(puts("No"));
if (box[p[cur]].a < box[p[cur]].b)
{
vector<int> temp;
for (int i = 1; i <= n; i ++)
if (i != p[cur] && check(box[i].a, box[p[cur]])) temp.emplace_back(i);
for (int i = 1; i <= n; i ++)
if (i != p[cur] && !check(box[i].a, box[p[cur]]) && box[p[cur]].b < box[i].a && box[i].a <= box[p[cur]].b + (int)temp.size() + 1) temp.emplace_back(i);
rest -= abs(box[p[cur]].b - box[p[cur]].a);
for (int i = 0; i < (int)temp.size(); i ++)
{
int id = temp[i];
rest -= box[p[cur]].b + i + 1 - box[id].a, box[id].a = box[p[cur]].b + i + 1;
if (rest < 0) return void(puts("No"));
}
box[p[cur]].a = box[p[cur]].b;
}
else if (box[p[cur]].a > box[p[cur]].b)
{
vector<int> temp;
for (int i = n; i >= 1; i --)
if (i != p[cur] && check(box[i].a, box[p[cur]])) temp.emplace_back(i);
for (int i = n; i >= 1; i --)
if (i != p[cur] && !check(box[i].a, box[p[cur]]) && box[p[cur]].b > box[i].a && box[i].a >= box[p[cur]].b - (int)temp.size() - 1) temp.emplace_back(i);
rest -= abs(box[p[cur]].b - box[p[cur]].a);
for (int i = 0; i < (int)temp.size(); i ++)
{
int id = temp[i];
rest -= box[id].a - (box[p[cur]].b - i - 1), box[id].a = box[p[cur]].b - i - 1;
if (rest < 0) return void(puts("No"));
}
box[p[cur]].a = box[p[cur]].b;
}
}
puts("Yes");
}
}
signed main()
{
File("move");
read(c, T);
while (T --) Pts44::solve();
return 0;
}