Mi Teleférico
문제
La Paz, the capital city of Bolivia, is famous as a tourist spot and for an aerial cable car called Mi Teleférico. You are now visiting La Paz for sightseeing, and you want to visit as many sightseeing places as possible. In this task, we consider the following simplified situation.
There are aerial cable car stations in La Paz, numbered from to in ascending order of altitude. There are one-way lines, numbered from to . There are aerial cable car companies, numbered from to . Each line is managed by a single company. Line (1 ≤ i ≤ M) is operated from station to station , and is managed by the company . Here, the line always runs from the lower altitude station to the higher altitude station. In other words, holds.
The Bureau of transportation of La Paz issued unlimited ride passes for convenience. Each ride pass contains integers , , which satisfy 1 ≤ l ≤ r ≤ P. The pass enables the possessor to ride lines, which are managed by any one of company . In other words, for an integer which satisfies 1 ≤ i ≤ M, the pass enables the possessor to ride line when l ≤ C_i ≤ r holds. It is possible to use a single pass for several lines. Let a ride pass denote this ride pass.
Now, tourists, numbered from to , visit La Paz. Tourist (1 ≤ j ≤ Q) has a ride pass and boliviano cash.
Each tourist’s goal is to ensure that no station cannot be travelled from station , using only lines that can be ridden with the ride pass he or she has. Tourist (1 ≤ j ≤ Q) can exchange his or her ride pass described in the following process to achieve their goal. Here, each tourist can exchange at most once.
- He or she chooses integers , , which satisfy 1 ≤ l' ≤ r' ≤ P.
- He or she exchanges a ride pass for a ride pass . It costs |L_j − l'| + |R_j − r'| boliviano as a fee.
Your purpose is to determine, for each tourist, whether or not he or she can achieve his or her goal within the cash he or she has.
Write a program which, given information about stations, lines, and tourists, determines whether or not he or she can achieve his or her goal within the cash he or she has for each tourist.
입력
Read the following data from the standard input.
출력
Write lines to the standard output. On the -th line (1 ≤ j ≤ Q), output Yes if tourist can achieve his or her goal, and No otherwise.
예제
예제 1
4 6 10 1 2 3 2 4 7 1 2 6 2 3 5 3 4 2 3 4 8 4 3 7 0 5 6 0 3 4 0 1 9 0
Yes No No Yes
예제 2
4 6 10 1 2 3 2 4 7 1 2 6 2 3 5 3 4 2 3 4 8 3 5 6 10 3 4 1 7 8 3
Yes No Yes
예제 3
3 1 1000000000 1 2 6 1 1 1000000000 1000000000
No
예제 4
5 9 2000 2 3 1814 2 3 457 1 2 1226 3 4 1354 1 5 1050 1 2 1725 2 3 1383 1 5 1626 1 4 1795 5 850 1872 128 82 428 1217 487 924 573 1639 1926 202 202 420 25
Yes Yes Yes Yes No