Score : $400$ points
You are given $N$ circles on the $xy$-coordinate plane. For each $i = 1, 2, \ldots, N$, the $i$-th circle is centered at $(x_i, y_i)$ and has a radius of $r_i$.
Determine whether it is possible to get from $(s_x, s_y)$ to $(t_x, t_y)$ by only passing through points that lie on the circumference of at least one of the $N$ circles.
Input is given from Standard Input in the following format:
$N$ $s_x$ $s_y$ $t_x$ $t_y$ $x_1$ $y_1$ $r_1$ $x_2$ $y_2$ $r_2$ $\vdots$ $x_N$ $y_N$ $r_N$
If it is possible to get from $(s_x, s_y)$ to $(t_x, t_y)$, print Yes
; otherwise, print No
.
Note that the judge is case-sensitive.
4 0 -2 3 3 0 0 2 2 0 2 2 3 1 -3 3 3
Yes
Here is one way to get from $(0, -2)$ to $(3, 3)$.
Thus, Yes
should be printed.
3 0 1 0 3 0 0 1 0 0 2 0 0 3
No
It is impossible to get from $(0, 1)$ to $(0, 3)$ by only passing through points on the circumference of at least one of the circles, so No
should be printed.