AT_abc460_b.Two Rings
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
There are two circles C1 and C2 on the xy-plane. In this problem, a circle refers to the circumference.
Circle C1 has its center at (X1,Y1) and radius R1.
Circle C2 has its center at (X2,Y2) and radius R2.
Determine whether circles C1 and C2 have a common point. In other words, determine whether there exists at least one point whose distance from (X1,Y1) is R1 and whose distance from (X2,Y2) is R2.
You are given T test cases; solve each one.
在 xy-平面中有两个圆 C1 和 C2。本题中,“圆”仅指圆周。
圆 C1 的圆心为 (X1,Y1),半径为 R1。
圆 C2 的圆心为 (X2,Y2),半径为 R2。
判断圆 C1 与 C2 是否存在公共点。换言之,判断是否存在至少一个点,它到 (X1,Y1) 的距离为 R1,且到 (X2,Y2) 的距离为 R2。
你将得到 T 组测试用例,请对每组用例求解。
输入格式
The input is given from Standard Input in the following format, where casei denotes the i-th test case:
T
case1
case2
⋮
caseT
Each test case is given in the following format:
X1 Y1 R1 X2 Y2 R2
输入从标准输入中给出,格式如下,其中 casei 表示第 i 个测试用例:
T
case1
case2
⋮
caseT
每个测试用例的格式如下:
X1 Y1 R1 X2 Y2 R2
输出格式
Output T lines. The i-th line should contain the answer for the i-th test case.
For each test case, output Yes if circles C1 and C2 have a common point, and No otherwise.
输出 T 行。第 i 行应包含第 i 个测试用例的答案。
对于每个测试用例,若圆 C1 与圆 C2 有公共点,则输出 Yes;否则输出 No。
输入输出样例
输入#1
7 0 0 2 2 3 2 0 0 2 2 3 1 1 2 5 3 2 1 5 4 2 8 8 3 2 1 5 5 1 2 0 0 1 0 0 1 0 0 500000000 1 1000000000 500000000
输出#1
Yes No No Yes Yes Yes No
说明/提示
Sample 1 Explanation:
For example, in the first test case, the relative positions of C1 and C2 are as shown in the following figure.

Constraints
- 1≤T≤100
- 0≤X1,Y1,X2,Y2≤109
- 1≤R1,R2≤109
- All input values are integers.
样例 1 解释:
例如,在第一个测试用例中,C1 与 C2 的相对位置如以下图所示。

约束条件
- 1≤T≤100
- 0≤X1,Y1,X2,Y2≤109
- 1≤R1,R2≤109
- 所有输入值均为整数。
输入解题思路,AI测评打分。不知道怎么写?