← All problemsSign in

The Donut Dilemma

Jane wants to be fit, but she also likes donuts. She eats m donuts at a given time, and each donut i has a calorie count,ci. After eating a donut with c calories, she must run at least 2j*c (where j is the number donuts she has already eaten) kilometers to maintain her weight. Given the individual calorie counts for each of the m donuts, find and print the minimum number of kilometers Jane must r

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