CF2167A.Square?

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Square?

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.

Input

The first line contains a single integer tt (1t1041 \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 (1a,b,c,d101 \le a, b, c, d \le 10) — the lengths of the sticks.

Output

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.

Note

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:

Samples

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
NO
YES
YES
NO
NO
YES
NO

在线编程 IDE

建议全屏模式获得最佳体验