#include<algorithm>
#include<cassert>
#include<iostream>
#include<vector>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
typedef pair<lint,pii>plpii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)

const int N=100400;
const int B=400;
const int C=N/B;
int acc[C];
int a[N];

bool check(int l,int r){
  //cerr<<"l r = " << l << " " << r << endl;
  int b=l/B;
  assert(r<=B*b+B);
  if(acc[b]==B)return true;
  for(int i=l;i<r;++i)if(a[i]==0)return false;
  return true;
}

void add_up(int l,int r){
  int b=l/B;
  assert(r<=B*b+B);
  if(acc[b]==B)return;
  for(int i=l;i<r;++i){
    if(a[i]==0)acc[b]++;
    a[i]=1;
  }
}

void check_integra(){
  rep(i,C){
    int cnt=0;
    rep(j,B){
      int val=a[i*B+j];
      assert(val==0||val==1);
      cnt+=val;
    }
    if(acc[i]!=B&&acc[i]!=cnt){
      cerr << "error in block " << i << endl;
      cerr << "acc[i] = " << acc[i] << ", which should be " << cnt << endl;
      assert (0);
    }
  }
  rep(i,100){
    cerr<<" "<<a[i];
  }
  cerr<<endl;
  rep(i,100/B){
    cerr<<" "<<acc[i];
  }
  cerr<<endl;
}

int main(){
  int n,m,q;
  cin>>n>>m>>q;
  vector<plpii>chr;
  rep(i,m+q){
    int d,a,b;
    cin>>d>>a>>b;
    a--,b--;
    chr.push_back(plpii((2*N)*(2*(lint)d+(i>=m?0:1))+i,pii(a,b)));
  }
  sort(chr.begin(),chr.end());
  vi ans(q,-1);
  rep(i,chr.size()){
    lint t=chr[i].first;
    pii lr=chr[i].second;
    int l=lr.first,r=lr.second;
    int lb=(l+B-1)/B,rb=r/B;
    if((t/(2*N))%2==0){
      bool ok=1;
      if(lb>rb){
	if(l>=r){
	  ok=1;
	}else{
	  ok=check(l,r);
	}
      }else{
	ok&=check(l,B*lb);
	for(int j=lb;j<rb;++j){
	  ok&=acc[j]==B;
	}
	ok&=check(B*rb,r);
      }
      int qn=t%(2*N)-m;
      assert(qn>=0&&qn<q);
      ans[qn]=ok;
    }else{
      if(lb>rb){
	add_up(l,r);
      }else{
	add_up(l,B*lb);
	for(int j=lb;j<rb;++j){
	  acc[j]=B;
	}
	add_up(B*rb,r);
      }
    }
    //check_integra();
  }
  rep(i,q){
    assert(ans[i]>=0);
    assert(ans[i]<=1);
    cout<<(ans[i]?"Yes":"No")<<endl;
  }
}


### Prompt

In CPP, your task is to solve the following 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

### Response

```cpp
#include<algorithm>
#include<cassert>
#include<iostream>
#include<vector>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
typedef pair<lint,pii>plpii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)

const int N=100400;
const int B=400;
const int C=N/B;
int acc[C];
int a[N];

bool check(int l,int r){
  //cerr<<"l r = " << l << " " << r << endl;
  int b=l/B;
  assert(r<=B*b+B);
  if(acc[b]==B)return true;
  for(int i=l;i<r;++i)if(a[i]==0)return false;
  return true;
}

void add_up(int l,int r){
  int b=l/B;
  assert(r<=B*b+B);
  if(acc[b]==B)return;
  for(int i=l;i<r;++i){
    if(a[i]==0)acc[b]++;
    a[i]=1;
  }
}

void check_integra(){
  rep(i,C){
    int cnt=0;
    rep(j,B){
      int val=a[i*B+j];
      assert(val==0||val==1);
      cnt+=val;
    }
    if(acc[i]!=B&&acc[i]!=cnt){
      cerr << "error in block " << i << endl;
      cerr << "acc[i] = " << acc[i] << ", which should be " << cnt << endl;
      assert (0);
    }
  }
  rep(i,100){
    cerr<<" "<<a[i];
  }
  cerr<<endl;
  rep(i,100/B){
    cerr<<" "<<acc[i];
  }
  cerr<<endl;
}

int main(){
  int n,m,q;
  cin>>n>>m>>q;
  vector<plpii>chr;
  rep(i,m+q){
    int d,a,b;
    cin>>d>>a>>b;
    a--,b--;
    chr.push_back(plpii((2*N)*(2*(lint)d+(i>=m?0:1))+i,pii(a,b)));
  }
  sort(chr.begin(),chr.end());
  vi ans(q,-1);
  rep(i,chr.size()){
    lint t=chr[i].first;
    pii lr=chr[i].second;
    int l=lr.first,r=lr.second;
    int lb=(l+B-1)/B,rb=r/B;
    if((t/(2*N))%2==0){
      bool ok=1;
      if(lb>rb){
	if(l>=r){
	  ok=1;
	}else{
	  ok=check(l,r);
	}
      }else{
	ok&=check(l,B*lb);
	for(int j=lb;j<rb;++j){
	  ok&=acc[j]==B;
	}
	ok&=check(B*rb,r);
      }
      int qn=t%(2*N)-m;
      assert(qn>=0&&qn<q);
      ans[qn]=ok;
    }else{
      if(lb>rb){
	add_up(l,r);
      }else{
	add_up(l,B*lb);
	for(int j=lb;j<rb;++j){
	  acc[j]=B;
	}
	add_up(B*rb,r);
      }
    }
    //check_integra();
  }
  rep(i,q){
    assert(ans[i]>=0);
    assert(ans[i]<=1);
    cout<<(ans[i]?"Yes":"No")<<endl;
  }
}


```