当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1221:Rectangle and Circle

题目描述
Given a rectangle and a circle in the coordinate system(two edges of the rectangle are parallel with the X-axis, and the other two are parallel with the Y-axis), you have to tell if their borders intersect.

Note: we call them intersect even if they are just tangent. The circle is located by its centre and radius, and the rectangle is located by one of its diagonal.


输入解释
The first line of input is a positive integer P which indicates the number of test cases. Then P test cases follow. Each test cases consists of seven real numbers, they are X,Y,R,X1,Y1,X2,Y2. That means the centre of a circle is (X,Y) and the radius of the circle is R, and one of the rectangle's diagonal is (X1,Y1)-(X2,Y2).
输出解释
For each test case, if the rectangle and the circle intersects, just output "YES" in a single line, or you should output "NO" in a single line.
输入样例
2
1 1 1 1 2 4 3
1 1 1 1 3 4 4.5
输出样例
YES
NO
来自杭电HDUOJ的附加信息
Author weigang Lee
Recommend Ignatius.L

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-1221

最后修改于 2020-10-25T22:43:01+00:00 由爬虫自动更新

共提交 3

通过率 100.0%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)