# Football Cup FOOTCUP Solution Codechef

## Football Cup FOOTCUP Solution Codechef

It is the final day of La Liga. Chef has a certain criteria for assessing football matches.
In particular, he only likes a match if:

The match ends in a draw, and, At least one goal has been scored by either team.
Given the goals scored by both the teams as X and Y respectively, determine whether Chef will like the match or not.

Input Format
The first line of input will contain a single integer T, denoting the number of test cases. The description of T test cases follows.
Each test case consists of a single line of input containing two space-separated integers X and Y â€” the goals scored by each team.

Output Format
For each test case, output YES if Chef will like the match, else output NO.

You may print each character of the string in uppercase or lowercase (for example, the strings YeS, yEs, yes and YES will all be treated as identical).

Constraints
1â‰¤Tâ‰¤100
0â‰¤X,Yâ‰¤9

Sample Input 1
4
1 1
0 1
0 0
2 2

Sample Output 1
YES
NO
NO
YES

Explanation

• Test case 1: It is a draw in which both teams have scored a goal, Chef will like this match.
• Test case 2: The game is not a draw. Hence, Chef will not like this match.
• Test case 3: Neither team scored a goal, so Chef will not like this match.
• Test case 4: It is a draw in which both teams scored 2 goals each. Chef will like this match.

### SOLUTION

Program: Football Cup FOOTCUP Solution Codechef in Python

``````for _ in range(int(input())):
n,m=list(map(int,input().split()))
if n==m and n!=0 or m!=0:
print("YES")
else:
print("NO")``````

Program: Football Cup FOOTCUP Solution Codechef in C++

``````#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
int a;
int b;
cin>>a>>b;
if(a>0 and b>0 and a==b)
{
cout<<"YES"<<endl;
}
else
{
cout<<"NO"<<endl;
}
}
return 0;
}``````

Program: Football Cup FOOTCUP Solution Codechef in Python

``````import java.io.*;
import java.util.*;
class Codechef
{
public static void main(String []args) throws java.lang.Exception
{
Scanner sobj = new Scanner(System.in);
int test = sobj.nextInt( );
while(test-->0)
{
int a = sobj.nextInt( );
int b = sobj.nextInt( );
if(a>0 || b>0)
{
if(a==b)
System.out.println("Yes");
else
System.out.println("No");
}
else
System.out.println("No");
}
}
}``````

Related: