A(q) = T(q)/q = 0.01q - 2 + 5000/q
Now use what you know from calculus to minimize this (take derivative, set it to equal to 0, ...)
Also, q needs to be a natural number, so make sure to take this into account.
As a side note, what company pays $5000 for 0 boxes? [edit: never mind, q > 0]