← All problemsSign in

Ulla Britta and Sticks

Ulla Britta is helping Pewdiepie build a bridge. She is given $N$ sticks of sizes $A[i]$ ($1 \leq i \leq N$) where $A[i]$ denotes the length of the $i^{th}$ stick. She is required to alter the sizes of the sticks such that if Pewdiepie picks any three consecutive sticks, the sticks must be able to form a **triangle**. She is allowed to **increase** the length of any stick by $1$ in a **

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