Problem A
Goblin Garden Guards
In an unprecedented turn of events, goblins recently launched an invasion against the Nedewsian city of Mlohkcots. Goblins—small, green critters—love nothing more than to introduce additional entropy into the calm and ordered lives of ordinary people. They fear little, but one of the few things they fear is water.
The goblin invasion has now reached the royal gardens, where the goblins are busy stealing fruit, going for joyrides on the lawnmower and carving the trees into obscene shapes, and King Lrac Fatsug has decreed that this nonsense stop immediately!
Thankfully, the garden is equipped with an automated sprinkler system. Enabling the sprinklers will soak all goblins within range, forcing them to run home and dry themselves.
Serving in the royal garden guards, you have been asked to calculate how many goblins will remain in the royal garden after the sprinklers have been turned on, so that the royal gardeners can plan their next move.
Input
The input starts with one integer
Then, for each goblin follows the position of the goblin as
two integers,
Then follows one integer
Finally, for each sprinkler follows the location of the
sprinkler as two integers
Output
Output the number of goblins remaining in the garden after the sprinklers have been turned on.
Sample Input 1 | Sample Output 1 |
---|---|
5 0 0 100 0 0 100 100 100 50 50 1 0 0 50 |
4 |