Milky-Dark Chocolates
There are $N$ *milky-dark* chocolates. The $i^{th}$ chocolate has a sweetness value of $A_i$, and a bitterness value of $B_i$. Note that both values can be negative. You are going to eat all $N$ chocolates in a period of $K$ days. On the first day, you start with the first chocolate. Each subsequent day, you continue eating from where you left off the previous day, consuming a contiguous block
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