AT_abc460_b.Two Rings

入门

通过率:0%

时间限制:2.00s

内存限制:1024MB

AC君温馨提醒

该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

There are two circles C1C_1 and C2C_2 on the xyxy-plane. In this problem, a circle refers to the circumference.
Circle C1C_1 has its center at (X1,Y1)(X_1, Y_1) and radius R1R_1.
Circle C2C_2 has its center at (X2,Y2)(X_2, Y_2) and radius R2R_2.
Determine whether circles C1C_1 and C2C_2 have a common point. In other words, determine whether there exists at least one point whose distance from (X1,Y1)(X_1, Y_1) is R1R_1 and whose distance from (X2,Y2)(X_2, Y_2) is R2R_2.

You are given TT test cases; solve each one.

在 xyxy-平面中有两个圆 C1C_1 和 C2C_2。本题中,“圆”仅指圆周。
圆 C1C_1 的圆心为 (X1,Y1)(X_1, Y_1),半径为 R1R_1。
圆 C2C_2 的圆心为 (X2,Y2)(X_2, Y_2),半径为 R2R_2。
判断圆 C1C_1 与 C2C_2 是否存在公共点。换言之,判断是否存在至少一个点,它到 (X1,Y1)(X_1, Y_1) 的距离为 R1R_1,且到 (X2,Y2)(X_2, Y_2) 的距离为 R2R_2。

你将得到 TT 组测试用例,请对每组用例求解。

输入格式

The input is given from Standard Input in the following format, where casei\mathrm{case}_i denotes the ii-th test case:

TT
case1\mathrm{case}_1
case2\mathrm{case}_2
⋮\vdots
caseT\mathrm{case}_T

Each test case is given in the following format:

X1X_1 Y1Y_1 R1R_1 X2X_2 Y2Y_2 R2R_2

输入从标准输入中给出,格式如下,其中 casei\mathrm{case}_i 表示第 ii 个测试用例:

TT
case1\mathrm{case}_1
case2\mathrm{case}_2
⋮\vdots
caseT\mathrm{case}_T

每个测试用例的格式如下:

X1X_1 Y1Y_1 R1R_1 X2X_2 Y2Y_2 R2R_2

输出格式

Output TT lines. The ii-th line should contain the answer for the ii-th test case.
For each test case, output Yes if circles C1C_1 and C2C_2 have a common point, and No otherwise.

输出 TT 行。第 ii 行应包含第 ii 个测试用例的答案。
对于每个测试用例,若圆 C1C_1 与圆 C2C_2 有公共点,则输出 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 C1C_1 and C2C_2 are as shown in the following figure.

image

Constraints

  • 1≤T≤1001 \leq T \leq 100
  • 0≤X1,Y1,X2,Y2≤1090 \leq X_1, Y_1, X_2, Y_2 \leq 10^9
  • 1≤R1,R2≤1091 \leq R_1, R_2 \leq 10^9
  • All input values are integers.

样例 1 解释:
例如,在第一个测试用例中,C1C_1 与 C2C_2 的相对位置如以下图所示。

image

约束条件

  • 1≤T≤1001 \leq T \leq 100
  • 0≤X1,Y1,X2,Y2≤1090 \leq X_1, Y_1, X_2, Y_2 \leq 10^9
  • 1≤R1,R2≤1091 \leq R_1, R_2 \leq 10^9
  • 所有输入值均为整数。

输入解题思路,AI测评打分。不知道怎么写?

首页