1. Given the function $S=|x-2|+|x-4|$.
(1) Find the minimum value of $S$;
(2) If for any real numbers $x, y$ the inequality
$$
S \geqslant m\left(-y^{2}+2 y\right)
$$

holds, find the maximum value of the real number $m$.
(1) Using the absolute value inequality, the answer is 2.
(2) From the problem, we know that for any real number $y$,
$$
m\left(-y^{2}+2 y\right) \leqslant 2
$$
holds. It is easy to find that the maximum value of $-y^{2}+2 y$ is 1. Therefore, $0 \leqslant m \leqslant 2$, and the maximum value of $m$ is 2.