← All problemsSign in

The Great Cut!

It's a fine Sunday morning and Rohil is sitting on the breakfast table, waiting for his breakfast to be served. In the meantime, his mom asks him to cut the square shaped butter cake into maximum number of pieces but with only X number of cuts. She also asks him to only make horizontal and vertical cuts (parallel to the sides of the cake), edge to edge. Input The first line of input contains an

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