Problem: problem

AOR Co., Ltd. is a $ N $ story building. There is no basement floor.
AOR Ika-chan is a squid, so she can go down the stairs, but not up.

I decided to install $ M $ elevators in the building because it would be inconvenient if I couldn't climb upstairs.
It takes time to install the elevator, and the $ i $ th elevator will be installed the night after $ D_i $ and will be mobile on all floors above the $ A_i $ floor and below the $ B_i $ floor.

You were asked $ Q $ questions by AOR Ika-chan. The $ i $ th question is, "Can I move from the $ S_i $ floor to the $ T_i $ floor at noon $ E_i $ days later?"
The only means of transportation are stairs and elevators. In addition, the time required for movement shall be negligible.



input

$ N \ M \ Q $
$ D_1 \ A_1 \ B_1 $
$ \ vdots $
$ D_M \ A_M \ B_M $
$ E_1 \ S_1 \ T_1 $
$ \ vdots $
$ E_Q \ S_Q \ T_Q $

output

Print Yes or No on one line for each question. However, answer in the order in which they are asked. Also, output a line break at the end.

Example

Input

5 1 2
3 1 5
3 1 5
4 1 5


Output

No
Yes

Solution (in CPP):

Solution:
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define int ll
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define PB push_back

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'[';
  REP(i, a.size()) {out<<a[i];if(i!=a.size()-1)out<<',';}
  out<<']';
  return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

// 遅延セグメントツリー
struct lazysegtree {
  int n;
  vector<int> dat, lazy;

  lazysegtree(){}
  lazysegtree(int n_) {
    n = 1; while(n < n_) n *= 2;
    dat.assign(n*2, 0);
    lazy.assign(n*2, 0);
  }

  // 区間の幅がlenの節点kについて遅延評価
  void eval(int len, int k) {
    // 遅延配列に何もなければ何もしない
    if(lazy[k] == 0) return;
    // 一番下の段でなければ遅延配列を伝播
    if(k*2+1 < n*2-1) {
      lazy[2*k+1] = lazy[k];
      lazy[2*k+2] = lazy[k];
    }
    // datに遅延配列の値を入れる
    dat[k] = lazy[k]*len;
    // 遅延配列をリセット
    lazy[k] = 0;
  }

  // [a, b)
  void update(int a, int b, ll x, int k, int l, int r) {
    eval(r-l, k);
    // 被ってなければ何もしない
    if(b <= l || r <= a) return;
    // 完全にかぶっていれば遅延
    if(a <= l && r <= b) {
      lazy[k] = x;
      eval(r-l, k);
      return;
    }
    // 下の節点を2つ見てそこから求める
    update(a, b, x, 2*k+1, l, (l+r)/2); update(a, b, x, 2*k+2, (l+r)/2, r);
    dat[k] = dat[2*k+1] + dat[2*k+2];
  }
  void update(int a, int b, ll x) { update(a, b, x, 0, 0, n); }

  // [a, b)
  ll query(int a, int b, int k, int l, int r) {
    eval(r-l, k);
    // 被っていなければ0
    if(b <= l || r <= a) return 0;
    // 完全にかぶっていればそこの節点の値
    if(a <= l && r <= b) return dat[k];
    // 左右それぞれに進む
    ll vl = query(a, b, 2*k+1, l, (l+r)/2);
    ll vr = query(a, b, 2*k+2, (l+r)/2, r);
    return vl + vr;
  }
  ll query(int a, int b) { return query(a, b, 0, 0, n); }
};

signed main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n, m, q;
  cin >> n >> m >> q;
  VVI vec;
  REP(i, m) {
    int d, a, b;
    cin >> d >> a >> b;
    d = d*2+1, a--, b--;
    vec.PB({d, a, b, 0, i});
  }
  REP(i, q) {
    int d, a, b;
    cin >> d >> a >> b;
    d = d*2, a--, b--;
    vec.PB({d, a, b, 1, i});
  }
  sort(ALL(vec));

  vector<bool> ans(q);
  lazysegtree seg(2*n);
  REP(i, vec.size()) {
    // 更新クエリ
    if(vec[i][3] == 0) {
      // vec[i][1] ~ vec[i][2] について更新
      seg.update(vec[i][1]*2, vec[i][2]*2+1, 1);
    }
    // 質問クエリ
    else {
      // 落下はいつでも可能
      if(vec[i][1] >= vec[i][2]) ans[vec[i][4]] = true;
      else if(seg.query(vec[i][1]*2, vec[i][2]*2+1) == vec[i][2]*2-vec[i][1]*2+1) {
        ans[vec[i][4]] = true;
      }
      // 移動が不可能
      else {
        ans[vec[i][4]] = false;
      }
    }
  }

  REP(i, q) cout << (ans[i]?"Yes":"No") << endl;

  return 0;
}