QNOT - Editorial

PROBLEM LINK:

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

Author: tanminati
Tester: sushil2006
Editorialist: iceknight1093

DIFFICULTY:

Cakewalk

PREREQUISITES:

None

PROBLEM:

A participant solving A problems beats a participant solving B problems if and only if A \ge 2B.

TanMinati solved X problems and Bhavy solved Y problems.
Did a participant who solved N problems beat both of them?

EXPLANATION:

The answer is Yes if N \ge 2X and N \ge 2Y, and No otherwise.
Both checks can be combined into a single one by checking if N \ge 2\cdot\max(X, Y).

A simple if condition does the job here.

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (PyPy3)
n, x, y = map(int, input().split())
print('Yes' if n >= 2*x and n >= 2*y else 'No')