#include #include using namespace std; using ll = long long; constexpr ll INF = 1ll << 60; using S = tuple; S op(S lhs, S rhs){ auto [a1, b1, c1] = lhs; auto [a2, b2, c2] = rhs; return make_tuple(max(a1, a1), min(b1, b2), min(c1, c2)); } constexpr S e(){ return make_tuple(-INF, INF, INF); } int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, Q; cin >> n; vector a(n); for(int i = 0; i < n; i++){ ll x, y, d; cin >> x >> y >> d; a[i] = make_tuple(y - d, x + y, -(x - y)); } atcoder::segtree seg(a); cin >> Q; while(Q--){ int s, l, r; cin >> s >> l >> r; s--, l--; auto [y, u, v] = op(a[s], seg.prod(l, r)); cout << (u + v > 2 * y ? "Yes" : "No") << '\n'; } }