Subin is playing StarCraft against Gangho. Subin has one Mutalisk left, and Gangho has N SCVs left.
Each SCV has some remaining health and cannot attack the Mutalisk, so Subin has already won this game.
One attack of the Mutalisk hits at most three different SCVs. The amount of health lost is decided by the order in which the SCVs are hit.
- The SCV hit first loses 9 health.
- The SCV hit second loses 3 health.
- The SCV hit third loses 1 health.
An SCV whose health drops to 0 or below is destroyed at once. A single attack cannot hit the same SCV twice, and it cannot hit an SCV that is already destroyed.
Given the remaining health of every SCV, write a program that finds the minimum number of attacks needed to destroy all of them.