#P49. Isoball: 2D Version
Isoball: 2D Version
题目描述
Isoball is a challenging and fun game, and in this problem, we consider its 2D version. Given the radius of a circle and its initial position, there is a rectangle on the plane, and your goal is to let the circle be in the interior of the rectangle. To do this, you determine the direction of movement for the circle (represented by a vector). Now, you want to know if there exists a moment (including the initial moment) when the circle moves in this direction to reach the goal.
For a circle with center at and radius , it is considered to be inside a rectangle with bottom-left corner at and top-right corner at if and only if , it holds that and , where are the horizontal and vertical coordinates of point , respectively.
输入格式
The first line contains an integer , indicating the number of test cases.
For each test case, the first line contains five integers , representing the initial horizontal and vertical coordinates of the circle's center, the radius of the circle, and the direction of movement. It's guaranteed that both and are not simultaneously equal to .
The second line contains four integers , representing the horizontal and vertical coordinates of the bottom-left and top-right corners of the rectangle. It's guaranteed that and .
输出格式
For each test case, output one line. If the goal can be achieved, output Yes; otherwise, output No.
5
0 0 1 1 0
2 -2 6 2
0 0 1 1 0
2 0 6 2
0 0 1 1 1
1 1 3 3
0 0 1 -1 -1
1 1 3 3
0 0 1 -1 1
-5 -5 5 5
Yes
No
Yes
No
Yes
题目大意
在二维平面上给你一个圆,圆的移动方向和一个矩形,问你这个圆有没有可能在一个时刻处于矩形内部。