CS2023_GIFT - Editorial

PROBLEM LINK:

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

Author: himanshu154
Tester: jay_1048576
Editorialist: iceknight1093

DIFFICULTY:

TBD

PREREQUISITES:

None

PROBLEM:

Om has X rupees, and can further obtain M rupees from Gymkhana funds.
He wants to buy a laptop worth N rupees for his girlfriend. Does he have enough money?

EXPLANATION:

The total amount of money with Om is X + M rupees.

So, the answer is Yes if N \leq X+M, and No otherwise.

TIME COMPLEXITY

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (Python)
x, n, m = map(int, input().split())
print('Yes' if n <= x+m else 'No')