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:
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;
typedef pair<P, P> PP;

#define MAX_N 200000

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

int par[MAX_N];
int rnk[MAX_N];
long long int num[MAX_N];

// 初期化
void init(int n){
	for(int i = 0; i < n; i++){
		par[i] = i;
		rnk[i] = 0;
        num[i] = i;
	}
}

// x の親を返す
int find(int x){
	if(par[x] == x){
		return x;
	}
	return par[x] = find(par[x]);
}

// x と y を併合する
void unite(int x, int y){
	int x_par = find(x);
	int y_par = find(y);
	if(x_par == y_par){
		return;
	}
	
	if(rnk[x_par] < rnk[y_par]){
		par[x_par] = y_par;
	}else{
		par[y_par] = x_par;
		if(rnk[x_par] == rnk[y_par]){
			rnk[x_par]++;
		}
	}
    num[x_par] = num[y_par] = max(num[x_par], num[y_par]);
}

// x, y が同じグループか判定
bool same(int x, int y){
	return (find(x) == find(y));
}

int ans[110000] = {};

int main(){
    int N, M, Q;
    cin >> N >> M >> Q;
    PP pp;
    vector<PP> v;
    long long int MUL = 1e12;
    for(int i = 0; i < M; i++){
        long long int D, A, B;
        cin >> D >> A >> B;
        pp = PP(P(D, 1), P(A, B));
        v.push_back(pp);
    }
    for(int i = 0; i < Q; i++){
        long long int D, A, B;
        cin >> D >> A >> B;
        pp = PP(P(D, 0), P(A, B + i * MUL));
        v.push_back(pp);
    }
    sort(v.begin(), v.end());
    init(MAX_N);
    for(int i = 0; i < v.size(); i++){
        int S = v[i].second.first;
        int T = v[i].second.second % MUL;
        int pos = v[i].second.second / MUL;
        if(v[i].first.second){
            int nex = num[find(S)];
            while(nex < T){
                unite(nex, T);
                nex = num[find(nex + 1)];
            }
        }else{
            ans[pos] = (num[find(S)] >= T);
        }
    }
    for(int i = 0; i < Q; i++){
        if(ans[i]){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}