← All problemsSign in

Weights

CodeChefRating 697Open on judge ↗

Chef is playing with weights. He has an object weighing $W$ units. He also has three weights each of $X, Y,$ and $Z$ units respectively. Help him determine whether he can measure the **exact** weight of the object with one or more of these weights. If it is possible to measure the weight of object with one or more of these weights, print `YES`, otherwise print `NO`. ### Input - The first line of

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