<s>[INST] Find the number of possible solutions in $x+y+z=30$ under conditions. 
Three variables $x,y,z$  have a sum of $30$. All three are Non-Negative integers.
  If any $2$ variables don't have the same value and exactly one variable has 
  value less than or equal to $3$, find the number of possible solutions ?

$a.)\ 98 \\
b.)\ 285 \\
c.)\ 68 \\
\color{green}{d.)\ 294\\}
$
I did 
$x=0,y+z=30\implies 31\ \text{ways}$
$x=1,y+z=29\implies 30\ \text{ways}$
$x=2,y+z=28\implies 29\ \text{ways}$
$x=3,y+z=27\implies 28\ \text{ways}$
Total ways=$118$ 
But the book is giving answer as $294$ .
I look for a short and simple way.
I have studied maths upto $12$th grade.
 [/INST] X+Y+Z=30 ; given any one of the number ranges from 0-3 and all other numbers start from 4.  Hence consider the following equations: 


*

*X=0 ; Y+Z=30 
The solution of the above equation is obtained from (n-1)C(r-1) formula.
Total solutions obtained = 29 of which (y,z): (2,27)(27,2)(2,28)(28,2)(1,29)(29,1) must not be counted since they contain 1,2,3 as a part of solution. So, total number of ways= 29-6= 23 ways.

*X=1; Y+Z=29 
Total solutions obtained = 28 of which (y,z): (2,27)(27,2)(1,28)(28,1)(3,26)(26,3) must not be counted since they contain 1,2,3 as a part of solution. So, total number of ways= 28-6= 22ways.

*X=2 ; Y+Z=28
Total solutions obtained = 27 of which (y,z): (1,27)(27,1)(2,26)(26,2)(3,25)(25,3) must not be counted since they contain 1,2,3 as a part of solution. So, total number of ways= 27-6= 21ways.

*X=3 ; Y+Z= 27
Total solutions obtained = 26 of which (y,z): (1,26)(26,1)(2,25)(25,2)(3,24)(24,3) must not be counted since they contain 1,2,3 as a part of solution. So, total number of ways= 26-6= 20 ways.
Total number of ways = 23+22+21+20
                                       = 84 ways
Total number of ways considering X,Y and Z = 84*3 = 252. 
</s>