Solution (source code)

= Solution

The hypothesis is possible only for $t\geq0$. For every $\lambda\in\sigma(x)\subset\mathbb R$,
$$
|t-\lambda|\leq\|t1-x\|\leq t,
$$
so $0\leq\lambda\leq2t$. The <spectral characterization of a positive element in a C-star algebra>[spectral characterization of a positive element in a C*-algebra] gives $x\geq0$.