The government is planning to build a walkway for tourists in the middle
of an oak forest. The forest can be represented as plane with
The walkway is represented as a rectangle with sides parallel to the axes. If the sides of walkway rectangle intersect any oak lattice points, such oaks need to be axed down. Oaks inside the rectangle do not represent problems and need not be cut down.
Ljubo is the state secretary of Forestry and a passionate nature lover,
so he ordered the secretary of Tourism to provide him with a list of
Ljubo plans to select the walkway that needs the smallest amount of oak trees to be cut down. Since we also like trees, would you be so kind and write a program that will determine the number of oaks that will be cut down for each walkway. Remember only the oaks intersecting the sides of the rectangle need to be cut.
Input Specification
The first line of input contains one integer
The next
The next line contains one integer
The next
Output Specification
Output
Scoring
Test data worth
Test data worth
Sample Input
6
1 2
3 2
2 3
2 5
4 4
6 3
4
2 2 4 4
2 2 6 5
3 3 5 6
5 1 6 6
Sample Output
3
4
0
1

Comments