CF2167A.Square?

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

You are given 44 sticks of lengths aa, bb, cc, and dd. You can not break or bend them.

Determine whether it is possible to form a square∗^{\text{∗}} using the given sticks.

∗^{\text{∗}}A square is defined as a polygon consisting of 44 vertices, of which all sides have equal length and all inner angles are equal. No two edges of the polygon may intersect each other.

给你 44 根长度分别为 aa、bb、cc 和 dd 的木棍。你不能折断或弯曲这些木棍。

判断是否能用给定的木棍构成一个正方形∗^{\text{∗}}。

∗^{\text{∗}}正方形定义为:由 44 个顶点组成的多边形,其所有边长度相等,且所有内角相等;该多边形的任意两条边均不得相交。

输入格式

The first line contains a single integer tt (1≤t≤1041 \le t \le 10^4) — the number of test cases.

The only line of each test case contains four integers aa, bb, cc, and dd (1≤a,b,c,d≤101 \le a, b, c, d \le 10) — the lengths of the sticks.

第一行包含一个整数 tt(1≤t≤1041 \le t \le 10^4)—— 测试用例的数量。

每个测试用例仅有一行,包含四个整数 aa、bb、cc 和 dd(1≤a,b,c,d≤101 \le a, b, c, d \le 10)—— 各根木棍的长度。

输出格式

For each test case, print "YES" if it is possible to form a square using the given sticks, and "NO" otherwise.

You may print each letter in any case (uppercase or lowercase). For example, the strings "yEs", "yes", "Yes", and "YES" will all be recognized as a positive answer.

对于每个测试用例,如果能用给定的木棍组成一个正方形,则输出 “YES”,否则输出 “NO”。

你可以以任意大小写形式输出每个字母(大写或小写)。例如,字符串 “yEs”、“yes”、“Yes” 和 “YES” 均会被识别为肯定回答。

输入输出样例

  • 输入#1

    7
    1 2 3 4
    1 1 1 1
    2 2 2 2
    1 2 1 2
    1 1 5 5
    5 5 5 5
    4 10 5 9

    输出#1

    NO
    YES
    YES
    NO
    NO
    YES
    NO

说明/提示

In the first test case, we can prove that we can't make a square.

In the second, third, and sixth test cases, we can make a square like this:

在第一个测试用例中,我们可以证明无法构成一个正方形。

在第二个、第三个和第六个测试用例中,我们可以这样构成一个正方形:

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

首页