← All problemsSign in

EVacuate to Moon

CodeChefRating 1479Open on judge ↗

Pesla needs to charge $N$ cars before sending them to space. The $i^{th}$ car has an energy capacity $A_i$ Watt-hours. There are $M$ power outlets. The $j^{th}$ outlet provides a power of $B_j$ Watt. If an outlet can charge **at most** one car and a car can be charged by **at most** one outlet, find the **maximum** total energy (in Watt-hours) stored in all cars after $H$ hours. Note: - A p

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