Program time limit: 1 second
Program memory limit: 512 MB
Given $n$ non-coinciding dartboards, dartboard $i$ has center $(x_i, y_i)$ and radius $r_i$.
You throw $m$ darts, dart $i$ lands at $(dx_i, dy_i)$.
Calculate the total number of darts that land within at least one dartboard. Darts that land on the edge of a dartboard also counts.
The first line contains two space seperated integers $n$ and $m$, the number of dartboards and darts.
The next $n$ lines each contain three space seperated integers $x_i$, $y_i$, and $r_i$, the center and radius of the $i$th dartboard.
The next $m$ lines each contain two space seperated integers $dx_i$ and $dy_i$, the coordinates of where the ith dart landed.
It is guaranteed that the dartboards don't coincide or fully lie on top of each other.
For all test cases:
Output a single integer, the total number of darts that land within at least one dartboard.
In Python, you could use the line print(answer)
.
In C or C++, you could use the line printf("%d\n", answer);
.
1 2
1 1 1
1 1
1 2
2
There is only one dartboard, with center $(1, 1)$ and radius $1$, and the darts lands exactly at the center and on the edge.
Your program will be run on the 1 sample case and multiple secret test cases one after another, and if it produces the correct output for all test cases, it solves the task. Recall that your final score on the task is the score of your highest scoring submission.
You haven't submitted to this task.