← All problemsSign in

Love The Cake

After end sems got over, two friends Parth & Ritik decided to go to a bakery store to buy a cake. After choosing a cake, it had atmost 2 colours: One was White, denoted by ‘W’ and another was Black, denoted by ‘B’. Now both of them agreed to cut the cake in such a way that there will be exactly one White piece and atmost $M$ total (White + Black) pieces in their cut from cake. Find the number o

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