49. Let $x, y, z \in [0,1]$, and $|x-y| \leqslant \frac{1}{2}, |y-z| \leqslant \frac{1}{2}, |z-x| \leqslant \frac{1}{2}$, find the maximum and minimum values of $W=x+y+z-xy-yz-zx$. (2010 China Southeast Mathematical Olympiad)
49. Since $x, y, z \in [0,1]$, we have $x+y+z \geqslant xy + yz + zx$, i.e., $W \geqslant 0$. Therefore, $W_{\text{min}} = 0$ if and only if $x = y = z = 0$ or $1$. It is easy to see that at least two of $x, y, z$ are no greater than $\frac{1}{2}$ or no less than $\frac{1}{2}$. Also, from $W = x + y + z - xy - yz - zx = x(1-y) + y(1-z) + z(1-x)$, we know that the problem remains unchanged if we replace $x, y, z$ with $1-x, 1-y, 1-z$, respectively. Therefore, we only need to consider the case where at least two of $x, y, z$ are no greater than $\frac{1}{2}$.

Assume without loss of generality that $0 \leqslant x \leqslant y \leqslant \frac{1}{2}$. Then, by $|y-z| \leqslant \frac{1}{2}$ and $|z-x| \leqslant \frac{1}{2}$, we get $0 \leqslant z \leqslant x + \frac{1}{2}$. From $0 \leqslant x + y \leqslant 1$, we have
$$\begin{aligned}
W = & (1-x-y)z + x + y - xy \leqslant \\
& (1-x-y)\left(x + \frac{1}{2}\right) + x + y - xy = \\
& -x^2 + \frac{3}{2}x + \frac{1}{2} + \left(\frac{1}{2} - 2x\right)y
\end{aligned}$$
(1) When $\frac{1}{4} \leqslant x \leqslant \frac{1}{2}$, $\frac{1}{2} - 2x \leqslant 0$, then
$$\begin{aligned}
W \leqslant & -x^2 + \frac{3}{2}x + \frac{1}{2} + \left(\frac{1}{2} - 2x\right)x = \\
& -\left(x - \frac{1}{3}\right)^2 + \frac{5}{6} \leqslant \frac{5}{6}
\end{aligned}$$

The equality holds if and only if $\left\{\begin{array}{l}x = y = \frac{1}{3} \\ z = x + \frac{1}{2}\end{array}\right.$, i.e., $\left\{\begin{array}{l}x = \frac{1}{3} \\ y = \frac{1}{3} \\ z = \frac{5}{6}\end{array}\right.$.
(2) When $\frac{1}{2} \leqslant x \leqslant 0$, $\frac{1}{2} - 2x \geqslant 0$, then $W \leqslant -x^2 + \frac{3}{2}x + \frac{1}{2} + \left(\frac{1}{2} - 2x\right)$.
$$\frac{1}{2} = -\left(x - \frac{1}{4}\right)^2 + \frac{13}{16} < \frac{5}{6}.$$

In summary, $W_{\text{max}} = \frac{5}{6}$.