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,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}

int N,M,Q;
map<int,vector<array<int,4>>> events;

int main(){
	cin>>N>>M>>Q;
	rep(i,M){
		int d,a,b;
		cin>>d>>a>>b;
		a--,b--;
		events[d].pb({1,a,b,0});
	}
	rep(i,Q){
		int e,s,t;
		cin>>e>>s>>t;
		s--,t--;
		events[e].pb({0,s,t,i});
	}
	set<int> yet;	//yet.count(i) <=> i x i+1
	rep(i,N) yet.insert(i);
	vector<bool> ans(Q);
	for(auto it:events){
		auto es = it.sc;
		sort(all(es));
		for(auto e:es){
			int type = e[0], l = e[1], r = e[2], qid = e[3];
			if(type==0){	//query
				int x = *yet.lower_bound(l);
				ans[qid] = x>r-1;
			}else{
				while(true){
					int x = *yet.lower_bound(l);
					if(x>r-1) break;
					yet.erase(x);
				}
			}
		}
	}
	rep(i,Q){
		if(ans[i]) puts("Yes");
		else puts("No");
	}
}