12 For all real numbers $r, s, t$ satisfying $1 \leqslant r \leqslant s \leqslant t$. Find
$$w=(r-1)^{2}+\left(\frac{s}{r}-1\right)^{2}+\left(\frac{t}{s}-1\right)^{2}+\left(\frac{4}{t}-1\right)^{2}$$

the minimum value.
12. By Cauchy-Schwarz inequality, we have \( w \geqslant \frac{1}{4}\left[(r-1)+\left(\frac{s}{r}-1\right)+\left(\frac{t}{s}-1\right)+\left(\frac{4}{t}-1\right)\right]^{2} \) \( =\frac{1}{4}\left(r+\frac{s}{r}+\frac{t}{s}+\frac{4}{t}-4\right)^{2} \). Also, \( r+\frac{s}{r}+\frac{t}{s}+\frac{4}{t} \geqslant 4 \sqrt[4]{r \cdot \frac{s}{r} \cdot \frac{t}{s} \cdot \frac{4}{t}} \) \( = 4 \sqrt{2} \), so \( w \geqslant 4(\sqrt{2}-1)^{2} \). Equality holds if and only if \( r=\sqrt{2}, s=2, t=2 \sqrt{2} \). Therefore, \( w_{\min }=4(\sqrt{2}-1)^{2} \).