I want to enforce the following ranges for a set of variables, where the ranges for each variable are discontinuous. For example, I have two sets of ranges for each variable,
\begin{align}\sf LB_1 &\le \sf variable\,1 \le UB1\\\sf LB_2 &\le\sf variable\,1 \le UB2\end{align}
where $\sf LB$ and $\sf UB$ are the lower and upper bounds respectively. As an example, for a variable $x$, I have the following ranges
\begin{align}0&\le x \le 20\\31&\le x \le 59.\end{align}
Then, I can introduce a binary variable $U$ and write the following constraint:
$$U\times{\sf LB_1}+(1-U)\times{\sf LB_2} \le x \le U\times\sf{UB_1}+(1-U)\times {\sf UB_2}.$$
However, if I have three ranges, where $x$ can be 0 or $2\le x\le 11$ or $45\le x\le 79$, how do I write a constraint for three ranges for a single variable?