How much does it cost to increase X attack to (X+1) attack?
Cost = 0.4*X^2
How much does it cost to increase X health to (X+4) health?
Cost = 0.4*(X-30)^2.
How much does it cost to upgrade from 12 attack to 24 attack?
0.4*[12^2 + 13^2 + 14^2 + 15^2 + 16^2 + 17^2 + 18^2 + 19^2 + 20^2 + 21^2 + 22^2 + 23^2]] = 1527
Post questions, I’ll answer what I know.