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:
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;

template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}

#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()

/* do your best */


// quoted from beet-aizu
template <typename T,typename E, typename F, typename G, typename H>
struct LazySegmentTree{
    //using F = function<T(T,T)>;
    //using G = function<T(T,E)>;
    //using H = function<E(E,E)>;
    int n,height;
    F f;
    G g;
    H h;
    T ti;
    E ei;
    vector<T> dat;
    vector<E> laz;
    LazySegmentTree(F f,G g,H h,T ti,E ei):
        f(f),g(g),h(h),ti(ti),ei(ei){}

    void init(int n_){
        n=1;height=0;
        while(n<n_) n<<=1,height++;
        dat.assign(2*n,ti);
        laz.assign(2*n,ei);
    }
    void build(const vector<T> &v){
        int n_=v.size();
        init(n_);
        for(int i=0;i<n_;i++) dat[n+i]=v[i];
        for(int i=n-1;i;i--)
            dat[i]=f(dat[(i<<1)|0],dat[(i<<1)|1]);
    }
    inline T reflect(int k){
        return laz[k]==ei?dat[k]:g(dat[k],laz[k]);
    }
    inline void eval(int k){
        if(laz[k]==ei) return;
        laz[(k<<1)|0]=h(laz[(k<<1)|0],laz[k]);
        laz[(k<<1)|1]=h(laz[(k<<1)|1],laz[k]);
        dat[k]=reflect(k);
        laz[k]=ei;
    }
    inline void thrust(int k){
        for(int i=height;i;i--) eval(k>>i);
    }
    inline void recalc(int k){    
        while(k>>=1)
            dat[k]=f(reflect((k<<1)|0),reflect((k<<1)|1));
    }
    void update(int a,int b,E x){
        thrust(a+=n);
        thrust(b+=n-1);
        for(int l=a,r=b+1;l<r;l>>=1,r>>=1){
            if(l&1) laz[l]=h(laz[l],x),l++;
            if(r&1) --r,laz[r]=h(laz[r],x);
        }
        recalc(a);
        recalc(b);
    }
    void set_val(int a,T x){
        thrust(a+=n);
        dat[a]=x;laz[a]=ei;
        recalc(a);
    }
    T query(int a,int b){
        thrust(a+=n);
        thrust(b+=n-1);
        T vl=ti,vr=ti;
        for(int l=a,r=b+1;l<r;l>>=1,r>>=1) {
            if(l&1) vl=f(vl,reflect(l++));
            if(r&1) vr=f(reflect(--r),vr);
        }
        return f(vl,vr);
    }
};

/* 
 *    [考えるべきこと]
 *    区間をマージしてから作用素を作用させても、作用素を作用させてから区間をマージするのと結果が同じ
 *    複数の作用素をマージして一度に作用させられること
 *    作用素を伝搬し終わっているのかの判定に必要（まあこれは満たされていなくても最悪どうにかなる）
 *    O(N) とかだと困る（setのマージとか）
 *    区間の長さに比例して作用が変わるときは，practice/RSRA や Library-Checher の RangeAffineRangeSum を参照する
 * 
 */

/**  テンプレ
int main(){
  using T = ***;  // type T
  using E = ***;  // type E
  auto f = [](T a, T b){ // return type T value
    return ***;
  };
  auto g = [](T a, E b){ // return type T value
    return ***;
  };
  auto h = [](E a, E b){ // return type E value
    return ***;
  };
  T ti = ***;  // identity element
  E ei = ***;  // identity element
  LazySegmentTree<T, E, decltype(f), decltype(g), decltype(h)> sg(f, g, h, ti, ei);  // don't change
  sg.build(***);
}
**/

int main() {

  int n, m, q; cin >> n >> m >> q;
  using P = pair<int, int>;
  auto f = [](P a, P b){ return P(a.first + b.first, a.second + b.second); };
  auto g = [](P a, int b){ return P(a.second * b, a.second); };
  auto h = [](int a, int b){ return b != INT_MAX ? b : a; };
  LazySegmentTree<P, int, decltype(f), decltype(g), decltype(h)> sg(f, g, h, P(0, 0), INT_MAX);
  sg.build(vector<P>(2 * n + 10, P(0, 1)));
  
  vector<tuple<lint, lint, lint, lint>> querys;
  for (int i = 0; i < m; i++) {
    lint d, a, b; cin >> d >> a >> b;
    querys.emplace_back(d * 2 + 1, -1, a, b);
  }


  for (int i = 0; i < q; i++) {
    int d, a, b; cin >> d >> a >> b;
    querys.emplace_back(d * 2, i, a, b);
  }

  sort(ALL(querys));
  vector<string> ans(q);

  for (auto q : querys) {
    int t, id, a, b;
    tie(t, id, a, b) = q;
    if (id == -1) {
      sg.update(2 * (a - 1), 2 * b - 1, 1);
    } else {
      if (a > b) {
        ans[id] = "Yes";
        continue;
      }
      int need = 2 * b - 2 * a + 1;
      int sum = sg.query(2 * (a - 1), 2 * b - 1).first;
      if (need == sum) {
        ans[id] = "Yes";
      } else {
        ans[id] = "No";
      }
    }
  }

  for (auto i : ans) {
    cout << i << endl;
  }
  
  return 0;
}