The equation given $18 = 3x + 2y + 1/2z$ where $x, y, z$ are positive integers and $20 = x+y+z$.
Now, not really knowing what to do, I multiplied through by $2$ to make it a linear Diophantine equation with three unknowns, this gives $36 = 6x + 4y + z$. Solving this using a technique I found on this site I was able to obtain a solution to the original equation: $18 = 3(36) + 2(-36) + (-36)1/2$.
As I said, that is a solution, but not within the constraints I want. $x, y, z$ are not all positive integers and they also don't sum up to $20$. (The correct solution is $x = 2$ and $y = 2$ and $z = 16$, found with Wolfram Alpha.)
Now, assuming I know how to solve linear Diophantine equations with three unknowns, how would I take the constraint into account that $x,y,z$ need to sum up to a certain positive integer? What would be the approach here to find the correct solution?