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>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/






int N, M, Q, D[101010], A[101010], B[101010], E[101010], S[101010], T[101010];
string ans[101010];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N >> M >> Q;
    rep(i, 0, M) cin >> D[i] >> A[i] >> B[i];
    rep(i, 0, Q) cin >> E[i] >> S[i] >> T[i];

    set<pair<int, int>> gr;
    rep(i, 0, N) gr.insert({ i + 1, i + 1 });

    vector<int> ele, ord;
    rep(i, 0, M) ele.push_back(i);
    sort(all(ele), [&](int a, int b) { return D[a] < D[b]; });
    rep(i, 0, Q) ord.push_back(i);
    sort(all(ord), [&](int a, int b) { return E[a] < E[b]; });

    int elei = 0;
    rep(_i, 0, Q) {
        int i = ord[_i];

        if (S[i] >= T[i]) {
            ans[i] = "Yes";
            continue;
        }

        while (elei < M) {
            int j = ele[elei];
            if (E[i] <= D[j]) break;

            int a = A[j];
            int b = B[j];

            auto itea = gr.lower_bound({ a, -1 });
            auto iteb = gr.lower_bound({ b, -1 });

            int l = itea->second;
            int r = iteb->first;

            iteb++;

            gr.erase(itea, iteb);
            gr.insert({ r, l });
            elei++;

            //printf("%d >> ", D[j]); fore(p, gr) printf("[%d %d] ", p.first, p.second); printf("\n");
        }

        auto itea = gr.lower_bound({ S[i], -1 });
        auto iteb = gr.lower_bound({ T[i], -1 });

        if (itea == iteb) ans[i] = "Yes";
        else ans[i] = "No";
    }

    rep(i, 0, Q) printf("%s\n", ans[i].c_str());
}