PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: notsoloud
Tester: mexomerf
Editorialist: iceknight1093
DIFFICULTY:
TBD
PREREQUISITES:
None
PROBLEM:
There are X schools with Y students each. Z students in total passed their exams.
Is the pass rate greater than 50\%?
EXPLANATION:
A pass rate of \gt 50\% means that more than half the students would need to pass the exam.
Since there are X schools and Y students in each of them, there are X\cdot Y students in total.
So, the pass rate is \gt 50\% if and only if
Z\gt \frac{X\cdot Y}{2}
Check this with an if
condition, and print Yes
or No
appropriately.
TIME COMPLEXITY:
\mathcal{O}(1) per testcase.
CODE:
Editorialist's code (Python)
for _ in range(int(input())):
x, y, z = map(int, input().split())
print('Yes' if 2*z > x*y else 'No')