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;
#define MAX_M 100005
#define MAX_Q 100005
#define MAX 200005

int N,M,Q;
int d[MAX_M],a[MAX_M],b[MAX_M];
int e[MAX_Q],s[MAX_Q],t[MAX_Q];
int ans[MAX_Q];

vector<int> X;
vector<int> g[MAX];
vector<int> G[MAX];

int main(){
  scanf("%d %d %d",&N,&M,&Q);
  for(int i=0;i<M;i++){
    scanf("%d %d %d",&d[i],&a[i],&b[i]);
    X.push_back(d[i]);
  }
  for(int i=0;i<Q;i++){
    scanf("%d %d %d",&e[i],&s[i],&t[i]);
    X.push_back(e[i]);
  }
  sort(X.begin(),X.end());
  X.erase( unique( X.begin(), X.end() ), X.end() );
  
  for(int i=0;i<M;i++){
    d[i]=lower_bound(X.begin(),X.end(),d[i])-X.begin();

    g[ d[i] ].push_back(i);
  }
  
  for(int i=0;i<Q;i++){
    e[i]=lower_bound(X.begin(),X.end(),e[i])-X.begin();

    G[ e[i] ].push_back(i);
  }

  set<int> st;
  for(int i=1;i<N;i++)st.insert(i);
  set<int> :: iterator it;
  
  for(int i=0;i<MAX;i++){
    
    for(int id:G[i]){
      int left=s[id], right=t[id];
      it=st.lower_bound(left);
      if( it==st.end() || *it >= right ){
        ans[id]=1;
      }else{
        ans[id]=0;
      }
    }
    
    for(int id:g[i]){
      int left=a[id], right=b[id];
      while(1){
        it=st.lower_bound(left);
        if(it==st.end() || *it >= right)break;
        st.erase(it);
      }
    }
  }
  for(int i=0;i<Q;i++){
    if(ans[i]){
      cout<<"Yes"<<endl;
    }else{
      cout<<"No"<<endl;
    }
  }
  return 0;
}