← All problemsSign in

Matchsticks

CodeChefRating 1714Open on judge ↗

Chef Ceil has some matchsticks in his kitchen. **Detail of matchsticks:** There are $N$ matchsticks in total. They are numbered from to $0$ to $N-1$ inclusive. The $i^{th}$ matchstick takes $b_{i}$ time to burn when lighted at one end, and it burns at a uniform rate. If lighted at both ends simultaneously, the matchstick will take only half of the original time to burn down. **Arrangement:**

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