Chef and Battery
Chef's phone has a battery level of $N$ percent. Each minute: - If the phone is on charging, the battery level **increases** by $2\%$. - Otherwise, the battery level **decreases** by $3\%$. Find the **minimum** time in which Chef can make the battery level reach **exactly** $50\%$. Note that the battery level should always lie in the range $0$ to $100$ (both included). ### Input - The first
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