# EXPERT - Editorial

Author: Kanhaiya Mohan
Tester: Tejas Pandey
Editorialist: Nishank Suresh

561

None

# PROBLEM:

A problemsetter has proposed X problems and Y out of them were approved. Is Y at least 50\% of X?

# EXPLANATION:

It is enough to directly check the condition: for Y to be at least 50\% of X, Y must satisfy the inequality 2Y \geq X.

So,

• The answer is “Yes” if 2Y \geq X
• The answer is “No” otherwise

# TIME COMPLEXITY

\mathcal{O}(1) per test case.

# CODE:

Editorialist's code (Python)
for _ in range(int(input())):
x, y = map(int, input().split())
print('Yes' if 2*y >= x else 'No')

1 Like