z-bullet
Mister Little Z started practicing shooting. He is practicing in a field with a lot of circular fences - fences in the shape of circles. He wonders how many different fences he can shoot (make a hole in) with only one bullet
Mister Little Z is at position x, y, he also knows all x and y positions of all the centers of the fences, as well as their radius. Fences can overlap, be one inside the other, or be exactly at the same place - weird but true! Mister Little Z fires a bullet that travels in a straight line. The bullet will make a hole in a fence if the line representing the bullet's trajectory touches the fence in at least one point. Be careful, fences can be anywhere!
Input:
1 1
3
1 1 10
100 100 10
-100 -100 10Output:
2Explanation, Mister little Z is inside one of the fences, he will hit that one, and one of the other two.
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.