I was playing Clash of Clans and came across this interesting problem. Consider the case when I'm attacking an enemy war base with an Archer. My archer can cause a damage of 12 hitpoint per second. The enemy's Archer Tower has a total hitpoint of 580, meaning it will take 580/12 hits by one archer for it to be completely destroyed.
The enemy Archer Tower can attack the archers too. The tower's damage-per-second value is 35, and the hit points of an archer is 28. So in a single shoot, the Archer Tower can kill one archer.
For example, if I deploy 10 archers to take out the enemy Archer Tower:
t = 1 second: 10 archers attacking : 12 x 10 hitpoints total; Remaining hitpoints of Tower = 580 - (12 x 10) = 460 hitpoints
t = 2 second: 9 archers attacking (1 archer is dead by now): 12 x 9 hitpoints total; remaining hitpoints of tower = 460 - 108 = 352 hitpoints
t = 3 second: 8 archers attacking (2 archers are dead by now): 12 x 8 hitpoints total; remaining hitpoints of tower = 352 - 96 = 256 hitpoints
My question is:
How many archers do I need to deploy to destroy the Archer Tower completely(assuming the Tower attacks the archers at the same time)?
I assume that the Archer Tower cannot split its $35$ damage over several archers. Then a group of $n$ archers can survive for $n$ seconds and cause $6(n^2+n)$ damage (this is because $1+2+\ldots+n=\frac{n^2+n}{2}$). So $9$ archers can cause $540$ damage and $10$ can cause $660$ damage before they are wiped out one by one.