Let $n \in \mathbb{N}$. How to find the least positive integer $\gamma$ such that $$ \sum\limits_{i=1}^{n} \cos{\theta_i} \leq \gamma$$ provided $$\prod\limits_{i=1}^{n} \tan{\theta_i} = 2^{\frac{n}{2}}$$ for any $\theta_i \in (0,\frac{\pi}{2})$, $i=1, 2, \ldots, n$?
I had trouble solving this problem, some time ago. If I am not mistaken, I had seen this in Loney's trigonometry book. (Although I don't remember it correctly!).