CodeChef : January Challenge 2018 – Rectangle

By | January 5, 2018

Rectangle

Source: CodeChef

You are given four integers abc and d. Determine if there’s a rectangle such that the lengths of its sides are abc and d (in any order).

Input

  • The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
  • The first and only line of each test case contains four space-separated integers abc and d.

Output

For each test case, print a single line containing one string "YES" or "NO".

Constraints

  • 1 ≤ T ≤ 1,000
  • 1 ≤ abcd ≤ 10,000

Subtasks

Subtask #1 (100 points): original constraints

Example

Input:

3
1 1 2 2
3 2 2 3
1 2 2 2

Output:

YES
YES
NO

Solution

Looks very easy in first go. However there is a catch you need to see. Else gives WA in beginning.