← All problemsSign in

Crushed Apples and a Balance Scale

CodeChefRating 1736Open on judge ↗

You are preparing for meals ahead of your busy night at Restaurant Deep Dishes. An essential ingredient is apples. In your inventory, you have $M$ kilograms of crushed apples. Head Chef Sandeep needs exactly $N$ kilograms of crushed apples, but Chef Pal has lost the weighing machine. Instead, all that is left is a balance pan with two scales. You do not have any measuring weights with you either

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