Number of solutions for an equation with constraints on each variable in the equation I have to find the number of solutions for: $$x_1 + x_2 + x_3 + x_4 = 42$$
when given:
$$ (I)  12 <= x_1 <=13 $$
$$ (II) 3 <= x_2 <= 6 $$
$$ (III) 11 <= x_3 <= 18 $$
$$ (IV) 6 <= x_4 <= 10 $$
What I did so far, is define:
$$ y_1 = x_1 - 12 $$
$$ y_2 = x_2 - 3 $$
$$ y_3 = x_3 - 11 $$
$$ y_4 = x_4 - 6 $$
Thus we get:
$$ y_1 + y_2 + y_3 + y_4 = 10 $$
where
$$ 0 <= y_1 <= 1 $$
$$ 0 <= y_2 <= 3 $$
$$ 0 <= y_3 <= 7 $$
$$ 0 <= y_4 <= 4 $$
now I defined:
$\text{S = all solutions to}$ $y_1 + y_2 + y_3 + y_4 = 20$
$\text{where all}$ $y_i >=0$ $\text{without the upper limitation}$
and I know I have to subtract the rest of the cases, when $y_1 is >1$ and $y_2 is >3$ etc... but how do I count all those side cases that I should subtract?

For the newer information on question, since $x_i$ are integral(which is same as saying that they are integers):
The answer will be coefficient of $x^{10}$ in the following expansion:
$$
\begin{align}
f(x) &= (x^0 + x^1)(x^0 + x^1 + x^2 + x^3)(x^0 + x^1 + x^2 + x^3 + x^4 + x^5 + x^6 + x^7)(x^0 + x^1 + x^2 + x^3 + x^4) \\
&= (1 + x)(1 + x + x^2 + x^3)(1 + x + x^2 + x^3 + x^4)(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7)
\end{align}
$$
