← All problemsSign in

Alex and Chocolates

Alex wants to enter an eating contest where all he has to eat are chocolates. The contest lasts $N$ days. But this isn't any ordinary eating contest. If Alex ate $X$ chocolates the day before yesterday and $Y$ chocolates yesterday then he has to eat $AY + BX$ chocolates today. Now Alex is really nervous about how he is going to perform and needs your help. Find the number of chocolates he has to e

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