← All problemsSign in

Mixing Liquids

CodeChefRating 553Open on judge ↗

Chef is now making orange juice! He has $A$ units of orange syrup, and $B$ units of water. To make orange juice, Chef must mix the orange syrup and the water in exactly a $1 : 2$ ratio, otherwise the recipe is spoilt. Further, Chef can **only use integer** amounts of liquids, because his measuring cylinder cannot accurately measure fractional quantities. Chef wants to make as much orange juice

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