Cost Computation
CodeChefOpen on judge ↗
Three people denoted by P1 , P2 , P3 intend to buy some rolls, buns, cakes and bread. Each of them needs these commodities in differing amounts and can buy them in two shops S1 , S2 . Which shop is the best for every person P1 , P2 , P3 to pay as little as possible? The individual prices and desired quantities of the commodities are given in the following tables: For example, the amount spent by
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.
Sign in to chat with the tutor and save your progress.
Sign in to start