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 "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)


//[l,r)
//dat[r] = l
#define Left second
#define Right first
class SEGMENTS{
private:
    map<int,int> dat;
    bool isInclude(int li, int ri, int L, int R){ return (L<=li && ri<=R); }
    
public:
    void erase(int l, int r){
        while(true){
            auto it = dat.upper_bound(l);
            if(it==dat.end() || r<=it->Left)break;
            
            int li = it->Left, ri = it->Right;
            dat.erase(it);
            
            if( !isInclude(li,ri,l,r) ){
                if( isInclude(l,r,li,ri) ){
                    if(li!=l) dat[l] = li;
                    if(r!=ri) dat[ri] = r;
                }else{
                    if(li<=l&&l<ri) ri = l;
                    if(l<=li&&li<r) li = r;
                    if(li!=ri) dat[ri] = li;
                }
            }
        }
    }
    
    void insert(int l, int r){
        while(true){
            auto it = dat.upper_bound(l);
            if(it==dat.end() || r<=it->Left){    //含む区間なし
                dat[r] = l;
                break;
            }else{
                if( isInclude(it->Left,it->Right,l,r) ) dat.erase(it);
                else{
                    l = min(l,it->Left);
                    r = max(r,it->Right);
                }
            }
        }
    }
    
    //Not validated.
    // if nothing: return pii(-1,-1);
    pii getIncludesSegment(int p){
        auto it = dat.upper_bound(p);
        if(it==dat.end() or it->Left>p)return pii(-1,-1);
        else return pii(it->Left,it->Right);
    }
    
    //Not validated.
    bool isSameSegment(int p1, int p2){
        pii a = getIncludesSegment(p1);
        pii b = getIncludesSegment(p2);
        if(a==pii(-1,-1) or b==pii(-1,-1))return false;
        
        return a==b;
    }
    
    int size(){ return dat.size(); }
    
    void output(){ for(auto e:dat)cout<<e.Left<<" "<<e.Right<<endl;cout<<endl; }
};


struct event{
    int t,a,b;
    int num;
    
    bool operator < (event obj) const{
        return this->t < obj.t;
    }
};

int main(){
    int n,m,q;
    cin>>n>>m>>q;
    
    vector<event> v;
    rep(i,m){
        int d,a,b;
        cin>>d>>a>>b;
        v.pb(event{2*d+1,a,b,-1});
    }
    rep(i,q){
        int e,s,t;
        cin>>e>>s>>t;
        v.pb(event{2*e,s,t,(int)i});
    }
    
    sort(all(v));
    
    SEGMENTS st;
    vector<bool> ans(q);
    for(auto elm:v){
        if(elm.num==-1){
            st.insert(elm.a,elm.b+1);
        }else{
            if(elm.a>=elm.b)ans[elm.num] = true;
            else{
                ans[elm.num] = st.isSameSegment(elm.a,elm.b);
            }
        }
    }
    for(auto elm:ans){
        if(elm)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}