Jerry Cheese
CodeChefOpen on judge ↗
Jerry is a health-conscious mouse who loves eating cheese. He likes cheese so much that he will eat **all** the available cheeses. Currently, he has $N$ cheese with distinct calorie value $a_1, a_2,...,a_n$. Jerry wants his total calorie intake to be $K$. To achieve his calorie diet, he can steal **at most** $1$ cheese such that: - its calorie value should lie between the minimum and maximum
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.
Sign in to chat with the tutor and save your progress.
Sign in to start