try to find the min value:
f(n)=100/cos(180/n)+200(n-1)tg(180/n).
This needs college level math. f ' (n) = blahblah. I am not sure my memorized formula is correct. I need google a little bit.
OR, we have to jump out of this logic to find some new trick to solve the problem.