If $\tan(x_1) \cdots\tan(x_n)=1$ for acute $x_i$, then does it follow that $\cos(x_1)+\cdots+\cos(x_n) \leq n\sqrt{2}/2$? It is easily seen that if $x,y\in[0,\pi/2)$ satisfy $\tan(x)\tan(y)=1$, then $$\cos(x)+\cos(y)\le\sqrt 2$$
A much more delicate fact is that if $\tan(x)\tan(y)\tan(z)=1$ (while $0\le x,y,z<\pi/2$), then 
$$\cos(x)+\cos(y)+\cos(z)\le \frac{3\sqrt 2}2$$
I can prove this, but the proof is a little complicated; can anybody suggest a nice, simple proof?

As a generalization, suppose that $n\ge 4$, $x_1,\dotsc,x_n\in[0,\pi/2)$, and $\tan(x_1)\dotsb\tan(x_n)=1$. Does it follow that
    $$ \cos(x_1)+\dotsb+\cos(x_n) \le \frac{n\sqrt 2}2? $$


For three variables we ca use C-S:
Let $\tan{x}=\sqrt{\frac{b}{a}},$ $\tan{y}=\sqrt{\frac{c}{b}},$ where $a$, $b$ and $c$ are positives.
Thus, $\tan{z}=\sqrt{\frac{a}{c}}$ and by C-S we obtain:
$$\sum_{cyc}\cos{x}=\sum_{cyc}\frac{1}{\sqrt{1+\tan^2x}}=\sum_{cyc}\sqrt{\frac{a}{a+b}}\leq$$
$$\leq\sqrt{\sum_{cyc}\frac{a}{(a+b)(a+c)}\sum_{cyc}(a+c)}\leq\frac{3}{\sqrt2},$$
where the last inequality it's just $$\sum_{cyc}c(a-b)^2\geq0.$$
The generalization is wrong for all $n\geq4$.
Try $x_1=x_2=...=x_{n-1}\rightarrow0^+$ and $x_n\rightarrow\frac{\pi}{2}^-$
