← All problemsSign in

Customer

There is customer who want to buy some products at the store. The total price of all the product he buys is given. He has exactly four notes with values a, b, c and d. He wants to know if it's possible to buy products without getting any change back. In other words, he wants to pay the exact price of a products using combination of notes he has. Output "YES" if it is possible or "NO" if it is not,

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