https://www.codechef.com/problems/STICKS

https://www.codechef.com/problems/STICKS

Hey, can you please explain your doubt?