CodechefMay 30, 2025

Exams

Hazrat Ali

Codechef

The year end results are in and a total of ZZ students passed the exams.

Assuming that all students appeared for the exams, find whether the number of students who passed in Chefland was strictly greater than 50%50%.

Input Format

  • The first line of input will contain a single integer TT, denoting the number of test cases.
  • Each test case consists of three space-separated integers X,Y,X,Y, and ZZ, as mentioned in the statement.

Output Format

For each test case, output on a new line, YES, if the total number of students who passed in Chefland was strictly greater than 50%50%, otherwise print NO.

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

Constraints

  • 1≤T≤2⋅104
  • 1≤X≤5
  • 1≤Y≤50
  • 0≤Z≤X⋅Y

Sample 1:

Input
4
2 10 12
2 10 3
1 5 3
3 6 9
Output
YES
NO
YES
NO


Solution
T = int(input())
for _ in range(T):
    X, Y, Z = map(int, input().split())
    total_students = X * Y
    if Z > total_students / 2:
        print("YES")
    else:
        print("NO")



 

Comments