Train Even or Odd
Chef will be going to the gym for some of the next $N$ days. On the $i$-th day, he is free to go to the gym for $A_i$ hours. Chef does not want to go the gym every day, because he is lazy. But he also does not want to miss too many days without going to the gym once. Thus, he decides that he will go **every alternate day**. He may go on days $1, 3, 5, \ldots$ or days $2, 4, 6, \ldots$. Find th
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