#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) begin(x), end(x)
#define debug(x) cout << #x " => " << (x) << endl
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
#endif
using lint = long long;
constexpr int MOD = (int)1e9 + 7;
constexpr double EPS = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

template <bool merge_adjacent>
class SectionUnion {
  struct comp { bool operator()(const pair<long long, long long> &a, const pair<long long, long long> &b) const { return a.second < b.second; } };

  public:
  set<pair<long long, long long>, comp> section_set;
  SectionUnion(void) {}
  pair<bool, pair<long long, long long>> get(const long long x) const {
    auto itr = section_set.lower_bound({0, x});
    return {!(itr == section_set.end() && x < itr->first), *itr};
  }
  bool insert(long long l, long long r) {
    auto litr = section_set.lower_bound({0, l - merge_adjacent}), ritr = section_set.lower_bound({0, r});
    if (ritr != section_set.end() && r + merge_adjacent >= ritr->first) ++ritr;
    const bool exist = litr != ritr;
    if (exist) {
      l = min(l, litr->first), r = max(r, prev(ritr)->second);
      section_set.erase(litr, ritr);
    }
    section_set.insert({l, r});
    return exist;
  }
  bool remove(long long l, long long r, bool involve = false) {
    auto litr = section_set.lower_bound({0, l}), ritr = section_set.lower_bound({0, r});
    if (ritr != section_set.end() && r >= ritr->first) ++ritr;
    const bool exist = litr != ritr;
    if (exist) {
      long long ledge = litr->first, redge = prev(ritr)->second;
      section_set.erase(litr, ritr);
      if (!involve) {
        if (ledge < l) section_set.insert({ledge, l - 1});
        if (r < redge) section_set.insert({r + 1, redge});
      }
    }
    return exist;
  }
  bool same(long long a, long long b) const {
    if (b < a) swap(a, b);
    auto itr = section_set.lower_bound({0, b});
    return itr != section_set.end() && itr->first <= a;
  }
  void clear(void) { section_set.clear(); }
  bool empty(void) const { return section_set.empty(); }
  int  size(void) const { return section_set.size(); }
};

int main(void) {
  int n, m, q;
  cin >> n >> m >> q;
  vector<pair<int, pair<int, int>>> put(m), query(q);
  rep (i, m) cin >> put[i].first >> put[i].second.first >> put[i].second.second;
  rep (i, q) cin >> query[i].first >> query[i].second.first >> query[i].second.second;
  auto allv = put;
  allv.insert(allv.end(), all(query));
  rep (i, m, m + q) allv[i].second.first = -allv[i].second.first;
  sort(all(allv));
  SectionUnion<false> su;
  map<pair<int, pair<int, int>>, bool> querymap;
  allrep (p, allv) {
    if (p.second.first > 0) {
      su.insert(p.second.first, p.second.second);
    } else {
      p.second.first = -p.second.first;
      querymap[p] = su.same(p.second.first, p.second.second);
    }
  }
  rep (i, q) cout << (query[i].second.first >= query[i].second.second || querymap[query[i]] ? "Yes" : "No") << "\n";
  return 0;
}

### Prompt

Construct a cpp code solution to the problem outlined:

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>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) begin(x), end(x)
#define debug(x) cout << #x " => " << (x) << endl
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
#endif
using lint = long long;
constexpr int MOD = (int)1e9 + 7;
constexpr double EPS = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

template <bool merge_adjacent>
class SectionUnion {
  struct comp { bool operator()(const pair<long long, long long> &a, const pair<long long, long long> &b) const { return a.second < b.second; } };

  public:
  set<pair<long long, long long>, comp> section_set;
  SectionUnion(void) {}
  pair<bool, pair<long long, long long>> get(const long long x) const {
    auto itr = section_set.lower_bound({0, x});
    return {!(itr == section_set.end() && x < itr->first), *itr};
  }
  bool insert(long long l, long long r) {
    auto litr = section_set.lower_bound({0, l - merge_adjacent}), ritr = section_set.lower_bound({0, r});
    if (ritr != section_set.end() && r + merge_adjacent >= ritr->first) ++ritr;
    const bool exist = litr != ritr;
    if (exist) {
      l = min(l, litr->first), r = max(r, prev(ritr)->second);
      section_set.erase(litr, ritr);
    }
    section_set.insert({l, r});
    return exist;
  }
  bool remove(long long l, long long r, bool involve = false) {
    auto litr = section_set.lower_bound({0, l}), ritr = section_set.lower_bound({0, r});
    if (ritr != section_set.end() && r >= ritr->first) ++ritr;
    const bool exist = litr != ritr;
    if (exist) {
      long long ledge = litr->first, redge = prev(ritr)->second;
      section_set.erase(litr, ritr);
      if (!involve) {
        if (ledge < l) section_set.insert({ledge, l - 1});
        if (r < redge) section_set.insert({r + 1, redge});
      }
    }
    return exist;
  }
  bool same(long long a, long long b) const {
    if (b < a) swap(a, b);
    auto itr = section_set.lower_bound({0, b});
    return itr != section_set.end() && itr->first <= a;
  }
  void clear(void) { section_set.clear(); }
  bool empty(void) const { return section_set.empty(); }
  int  size(void) const { return section_set.size(); }
};

int main(void) {
  int n, m, q;
  cin >> n >> m >> q;
  vector<pair<int, pair<int, int>>> put(m), query(q);
  rep (i, m) cin >> put[i].first >> put[i].second.first >> put[i].second.second;
  rep (i, q) cin >> query[i].first >> query[i].second.first >> query[i].second.second;
  auto allv = put;
  allv.insert(allv.end(), all(query));
  rep (i, m, m + q) allv[i].second.first = -allv[i].second.first;
  sort(all(allv));
  SectionUnion<false> su;
  map<pair<int, pair<int, int>>, bool> querymap;
  allrep (p, allv) {
    if (p.second.first > 0) {
      su.insert(p.second.first, p.second.second);
    } else {
      p.second.first = -p.second.first;
      querymap[p] = su.same(p.second.first, p.second.second);
    }
  }
  rep (i, q) cout << (query[i].second.first >= query[i].second.second || querymap[query[i]] ? "Yes" : "No") << "\n";
  return 0;
}

```