← All problemsSign in

Chef and Enemies

Chef has N enemies. Chef knows that his enemies will come one after another at positive integral minutes Ai (Ais are in strictly increasing order) after midnight. Now Chef has an infinite storage of machine guns, each machine gun fires continuously for R minutes and then stops, however he needs to spend 1 minute to set up a machine gun before he can fire it. However he needs to fire at least K m

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