As we all know,
is filthy rich. Whether it's from tutoring chess or winning bets with Mr. Fraschetti, it's no doubt that he's drowning in John A. Macdonald's and Queen Elizabeth's. And true to his name, it comes off as no surprise that he blows all of his hard earned cash on perogis, to fuel his unearthly addiction (next to reloading TeachAssist of course).One night,
runs up to you in a panic, and tells you that his arch-nemesis tripped him while he was walking home from the store, flinging the perogies he was holding all around the area. However, there's only one street light in the area, and due to the limitations I've created in this fictional world to facilitate the coherence of this problem, only perogies under that lamp's circle of light can be seen by the naked eye.needs you to find the number of perogis that can be seen under the street light. But he reminds you that Serogi's Perogis are special; they are rectangles that come in various sizes, and will always be aligned with the x and y axis (nice realistic problem sankeeth that definetely makes sense). Any perogi that touches any point in the circle of light should be counted as seen.
Input Specification
The first line of the input will contain integers denoting the , , and of the circle of light.
The second line will contain an integer , the number of perogies dropped.
The next lines will contain integers denoting the , , (of the bottom-left corner), , and of each perogi.
Constraints
Output Specification
The number of perogis that can be seen under the light.
Sample Input
9 6 3
7
9 10 8 5
6 9 8 4
8 4 7 9
6 7 3 10
3 6 1 2
9 10 3 9
2 9 4 9
Sample Output
3
Comments