Rectangle ||codechef||beginner solution ||programming info

Rectangle 

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 USING C LANGUAGE:-
#include <stdio.h>
int main(void) {
    int T,a,b,c,d,i;
    scanf("%d\n",&T);
    for(i=0;i<T;i++)
    {
        scanf("%d %d %d %d",&a,&b,&c,&d);
        printf("\n");
        if(a == b == c == d)
        printf("YES\n");
        else if(a == b && c == d)
         printf("YES\n");
        else if(a == d && c == b)
         printf("YES\n");
        else if(a == c && b == d)
         printf("YES\n");
        else
         printf("NO\n");
    }
	// your code goes here
	return 0;
}


Share:

No comments:

Post a Comment

Translate

Recommended platforms

  1. codechef
  2. hackerrank
  3. codeforces
  4. leetcode
  5. hackerearth

Popular Posts

programming_info. Powered by Blogger.

Blog Archive

Recent Posts

other platforms

  • geeks for geeks
  • w3schools
  • codepen
  • skillshare
  • udemy

Pages

reader support Support