MORNINGRUN - Editorial

PROBLEM LINK:

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

Author: sezalmittal987
Tester: kaori1
Editorialist: iceknight1093

DIFFICULTY:

TBD

PREREQUISITES:

None

PROBLEM:

A rectangular park is X meters long and Y meters wide.
Can you run at least 1000 meters with a single loop around this park?

EXPLANATION:

A single loop of the park is, in other words, its perimeter.
Being a rectangle with dimensions X and Y, this park’s perimeter is exactly 2\cdot (X+Y) meters.

So, the answer is Yes if 2\cdot (X+Y) \geq 1000, and No otherwise.

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (Python)
x, y = map(int, input().split())
print('Yes' if 2*(x+y) >= 1000 else 'No')