FOOTCUP - Editorial

PROBLEM LINK:

Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4

Author: Tejas Pandey
Testers: Satyam, Abhinav Sharma
Editorialist: Nishank Suresh

DIFFICULTY:

To be calculated

PREREQUISITES:

None

PROBLEM:

Chef only likes a football match if it ends in a draw, and both teams scored at least one goal. Given the number of goals scored by both teams in a match, X and Y, determine if Chef liked the match or not.

EXPLANATION:

All that needs to be done is to check whether the given two conditions hold, which is a simple application of the if condition — check if X equals Y and if X > 0. Note that when both of these conditions are satisfied, Y is automatically known to be greater than 0 so there is no need to explicitly check for this.

TIME COMPLEXITY:

\mathcal{O}(1) per test.

CODE:

Python
for _ in range(int(input())):
	x, y = map(int, input().split())
	if x == y and x > 0:
		print("yes")
	else:
		print("no")