1. Given
$$
|x+2|+|1-x|=9-|y-5|-|1+y| \text {. }
$$

Find the maximum and minimum values of $x+y$.
By the geometric meaning of absolute value, we have
$$
|x+2|+|x-1| \geqslant 3,|y-5|+|y+1| \geqslant 6 \text {. }
$$

Therefore, $|x+2|+|x-1|=3,|y-5|+|y+1|=6$.
Thus, $-2 \leqslant x \leqslant 1,-1 \leqslant y \leqslant 5$.
Hence, the maximum value of $x+y$ is 6, and the minimum value is -3.