SP10078 HAPPYTL - Happy Telephones
Description
In the land of Eden, all phone conversations are happy ones. People complaining on the phone are immediately put in jail. To enforce this law, the police taps all phone conversations.
The police wants to hire the appopiate number of operators to listen to all conversations in a given period of time. Unfortunately, each of their operators can listen to one conversation only before needing a really long break to rest from the effort.
As a contractor of the police department, you have been asked to provide a program capable of determining the required number of operators. If the program does not work correctly, you will be put in jail as well, along with all the unhappy complainers. Do you really want to end up there?
**Input**
Each test case starts with two integers denoting the number of phone calls _N_ (1 N < 10 000) and the number of intervals _M_ (1 M < 100). This is followed by _N_ lines describing the telephone calls, each one consisting of four integers _Source_, _Destination_, _Start_ and _Duration_. _Source_ and _Destination_ identify the pair of telephone numbers establishing the connection (0 Source, _Destination_ Start and _Duration_ are the start time and duration of the call in seconds (1 Duration Start >= 0). You can safely assume that the sum of _Start_ and _Duration_ fits into a 32-bit signed integer.
Afterwards follow _M_ lines containing the time intervals the police are interested in, each described by two integers _Start_ and _Duration_, in the same format and with the same meaning and constraints as those in the telephone calls. The last test case is represented by _N_ = _M_ = 0 and must not be processed.
**Output**
For each of the _M_ intervals of each test case, print the number of calls that are active during at least one second of the interval.
**Sample Input**
```
3 2
3 4 2 5
1 2 0 10
6 5 5 8
0 6
8 2
1 2
8 9 0 10
9 1
10 1
0 0
```
Input Format
N/A
Output Format
N/A