CodechefJun 01, 2025

Expert Setter

Hazrat Ali

Codechef

A problem setter is called an expert if at least 50%50% of their problems are approved by Chef.

Munchy submitted XX problems for approval. If YY problems out of those were approved, find whether Munchy is an expert or not.

Input Format

  • The first line of input will contain a single integer TT, denoting the number of test cases.
  • Each test case consists of a two space-separated integers XX and YY - the number of problems submitted and the number of problems that were approved by Chef.

Output Format

For each test case, output on a new line YES, if Munchy is an expert. Otherwise, print NO.

The output is case-insensitive. Thus, the strings YESyesyeS, and Yes are all considered the same.

Constraints

  • 1≤T≤1000
  • 1≤Y≤X≤106

Sample 1:

Input
4
5 3
1 1
4 1
2 1
Output
YES
YES
NO
YES

Solution
t = int(input())
while t != 0:
    a, b = map(int, input().split())
    temp = (b * 100) //a
    if temp >= 50:
        print("YES")
    else:
        print("NO")
    t -= 1





 

Comments