← All problemsSign in

Break the Stick

CodeChefRating 1026Open on judge ↗

Chef has a stick of length $N$. He can break the stick into $2$ or more parts such that the [parity](https://en.wikipedia.org/wiki/Parity_(mathematics)) of length of each part is same. For example, a stick of length $11$ can be broken into three sticks of lengths $\{3, 3, 5\}$ since each part is odd, but it cannot be broken into two sticks of lengths $\{5, 6\}$ since one is even and the other is

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