← All problemsSign in

Join States

CodeChefRating 1043Open on judge ↗

To curb the declining literacy in Chefland, the government has come up with a new plan. You are given an array $A$ of size $N$ denoting the initial count of literate people in each of the $N$ states of Chefland. The government wants the count of literate people in each state to be **at least** $M$. To do this, the government can combine two or more **consecutive** states to represent a new st

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