Problem Statement
在二维平面上有 N 个圆,圆心为(x_i,y_i),半径为r_i。
给出起点(sx,sy)和终点(tx,ty),
求在有限次行动内是否可以从起点走到终点。
每次行动,可以选择一个圆,要求当前点被这个圆包含。
然后将这个圆旋转任意角度,而这个点会随着这个圆同步旋转。
范围:N <= 50,
-10^9 <= x_i,y_i,r_i,sx,sy,tx,ty <= 10^9。
Fox Ciel is playing the "DJ Box" set of levels in the "Cut the Rope" game on her smartphone.
In the current level, she is facing the following problem:
The level can be seen as a two-dimensional plane that contains a single candy and some disks.
You are given the description of the level: int[]s x, y, and r; and ints sx, sy, tx, and ty.
The int[]s x, y, and r describe the disks:
For each i, there is a disk centered at (x[i], y[i]) with radius r[i].
Some of the disks may overlap.
The candy is initially located at (sx, sy), and the goal of the game is to move it to (tx, ty).
The game is played by rotating some of the disks, one after another.
More precisely, in each step, Ciel may choose any disk that currently contains the candy, and rotate the disk by any desired angle around its center.
The candy rotates with the chosen disk.
Other disks are ignored during the rotation.
(If the candy is located exactly on the border of a disk, we still consider it to be on the disk.)
Return "YES" if she can solve the level in finitely many steps, and "NO" otherwise.
You have two disks. You can win the level by first rotating the yellow disk to move the candy from S to A = (2,1), and then rotating the green disk to move the candy from A to T.