#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

struct StarrySkyTree {
  vector<ll> seg, lazy;
  ll size;
  StarrySkyTree() {}
  StarrySkyTree(ll n) {
    init(n);
  }
  void init(ll n) {
    size = 1;
    while (size < n) size *= 2;
    seg.resize(size * 2);
    lazy.resize(size * 2);
    for(int i = 0; i < size*2; i++)seg[i]=INF;
  }
  void update(ll k,ll v){
    k += size-1;
    seg[k] = v;
    while(k > 0){
      k = (k - 1)/2;
      seg[k] = min(seg[k * 2 + 1], seg[k * 2 + 2]);
    }
  }
  void push(ll k,ll l,ll r) {
    seg[k] += lazy[k];
    if (r - l > 1) {
      lazy[k * 2 + 1] += lazy[k];
      lazy[k * 2 + 2] += lazy[k];
    }
    lazy[k] = 0;
  }
  void add(ll a,ll b, ll v, ll k, ll l,ll r) {
    push(k, l, r);
    if (r <= a || b <= l) return;
    if (a <= l && r <= b) {
      lazy[k] += v;
      push(k, l, r);
    } else {
      add(a, b, v, k * 2 + 1, l, (l + r) / 2);
      add(a, b, v, k * 2 + 2, (l + r) / 2, r);
      seg[k] = min(seg[k * 2 + 1], seg[k * 2 + 2]);
    }
  }
  void add(ll a,ll b, ll v) {
    add(a, b, v, 0, 0, size);
  }
  ll query(ll a,ll b, ll k, ll l, ll r) {
    push(k, l, r);
    if (r <= a || b <= l) return INF*10;
    if (a <= l && r <= b) return seg[k];
    ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return min(vl,vr);
  }
  ll query(ll a, ll b) {
    return query(a, b, 0, 0, size);
  }
};

struct query{
  ll type,d,s,t;
  ll idx;
};
bool operator<(const query& a,const query& b){
  if(a.d==b.d)return a.type > b.type;
  else return a.d < b.d;
}

ll n,m,q;
string res[101010];
vector<query> qs;

int main(){
  cin>>n>>m>>q;
  rep(i,m){
    ll d,s,t;
    cin>>d>>s>>t;
    s--; t--;
    qs.push_back((query){0,d,s,t,-1});
  }
  rep(i,q){
    ll d,s,t;
    cin>>d>>s>>t;
    s--;t--;
    qs.push_back((query){1,d,s,t,i});
  }
  sort(all(qs));
  StarrySkyTree sgt;
  sgt.init(n-1);
  rep(i,n-1)sgt.update(i,0);
  rep(i,qs.size()){
    if(qs[i].type==0){ // add
      sgt.add(qs[i].s,qs[i].t,1);
    }else{
      ll minv=sgt.query(qs[i].s,qs[i].t);
      if(qs[i].s<=qs[i].t&&minv==0) res[qs[i].idx]="No";
      else res[qs[i].idx]="Yes";
    }
  }
  rep(i,q)cout<<res[i]<<endl;
  return 0;
}


### Prompt

Create a solution in CPP for 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 <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

struct StarrySkyTree {
  vector<ll> seg, lazy;
  ll size;
  StarrySkyTree() {}
  StarrySkyTree(ll n) {
    init(n);
  }
  void init(ll n) {
    size = 1;
    while (size < n) size *= 2;
    seg.resize(size * 2);
    lazy.resize(size * 2);
    for(int i = 0; i < size*2; i++)seg[i]=INF;
  }
  void update(ll k,ll v){
    k += size-1;
    seg[k] = v;
    while(k > 0){
      k = (k - 1)/2;
      seg[k] = min(seg[k * 2 + 1], seg[k * 2 + 2]);
    }
  }
  void push(ll k,ll l,ll r) {
    seg[k] += lazy[k];
    if (r - l > 1) {
      lazy[k * 2 + 1] += lazy[k];
      lazy[k * 2 + 2] += lazy[k];
    }
    lazy[k] = 0;
  }
  void add(ll a,ll b, ll v, ll k, ll l,ll r) {
    push(k, l, r);
    if (r <= a || b <= l) return;
    if (a <= l && r <= b) {
      lazy[k] += v;
      push(k, l, r);
    } else {
      add(a, b, v, k * 2 + 1, l, (l + r) / 2);
      add(a, b, v, k * 2 + 2, (l + r) / 2, r);
      seg[k] = min(seg[k * 2 + 1], seg[k * 2 + 2]);
    }
  }
  void add(ll a,ll b, ll v) {
    add(a, b, v, 0, 0, size);
  }
  ll query(ll a,ll b, ll k, ll l, ll r) {
    push(k, l, r);
    if (r <= a || b <= l) return INF*10;
    if (a <= l && r <= b) return seg[k];
    ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return min(vl,vr);
  }
  ll query(ll a, ll b) {
    return query(a, b, 0, 0, size);
  }
};

struct query{
  ll type,d,s,t;
  ll idx;
};
bool operator<(const query& a,const query& b){
  if(a.d==b.d)return a.type > b.type;
  else return a.d < b.d;
}

ll n,m,q;
string res[101010];
vector<query> qs;

int main(){
  cin>>n>>m>>q;
  rep(i,m){
    ll d,s,t;
    cin>>d>>s>>t;
    s--; t--;
    qs.push_back((query){0,d,s,t,-1});
  }
  rep(i,q){
    ll d,s,t;
    cin>>d>>s>>t;
    s--;t--;
    qs.push_back((query){1,d,s,t,i});
  }
  sort(all(qs));
  StarrySkyTree sgt;
  sgt.init(n-1);
  rep(i,n-1)sgt.update(i,0);
  rep(i,qs.size()){
    if(qs[i].type==0){ // add
      sgt.add(qs[i].s,qs[i].t,1);
    }else{
      ll minv=sgt.query(qs[i].s,qs[i].t);
      if(qs[i].s<=qs[i].t&&minv==0) res[qs[i].idx]="No";
      else res[qs[i].idx]="Yes";
    }
  }
  rep(i,q)cout<<res[i]<<endl;
  return 0;
}


```