← All problemsSign in

Ciel and Eggs

CodeChefRating 2024Open on judge ↗

Chef Ciel has N strange eggs. The i-th egg is broken by tapping exactly Ai times. Ciel needs to break K eggs as soon as possible for cooking a rice omelet. However she has been put in an uncomfortable situation. Someone shuffled the eggs! Ciel knows the values Ai, however she doesn't know which egg is which. She'd like to minimize the worst-case number of taps. What is the minimal number? Input

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