← All problemsSign in

Chef and Gym

CodeChefRating 496Open on judge ↗

Chef has decided to join a Gym in ChefLand and if possible, also hire a personal trainer at the gym. The monthly cost of the gym is $X$ and personal training will cost him an additional $Y$ per month. Chef's total budget per month is only $Z$. Print `1` if Chef can only join the gym, `2` if he can also have a personal trainer, and `0` if he can't even join the gym. **Note** that if Chef wants to

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start