PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: mathmodel
Tester: mexomerf
Editorialist: iceknight1093
DIFFICULTY:
cakewalk
PREREQUISITES:
None
PROBLEM:
Chef has X dollars, and his parents give him Y more. He needs A dollars to buy socks for Christmas, does he have enough?
EXPLANATION:
Along with the money from his parents, Chef has (X + Y) dollars. So, Chef can buy the socks if and only if (X+Y)\geq A.
This can be checked using an if
condition.
TIME COMPLEXITY:
\mathcal{O}(1) per testcase.
CODE:
Editorialist's code (PyPy3)
a, x, y = map(int, input().split())
print('Yes' if a <= x + y else 'No')