← All problemsSign in

Chef Bakes Cake 3

CodeChefRating 953Open on judge ↗

Chef is an expert baker. Each cake costs him $30$ coins to make, and then he sells each for $50$ coins. Chef is going to sell cakes for $N$ days, numbered $1, 2, \ldots, N$. On the $i$-th day, $A_i$ customers will visit Chef's shop and buy exactly $1$ cake each (if Chef has any cakes available, that is). However, Chef preferring uniformity, will always produce the same number of cakes at the sta

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