I am looking for a way to produce a given total ($n$) using fixed parts $(a, b, c)$ in multiples $(x, y, z)$: $ax+by+cz=n$, in such a way that $x+y+z$ is as small as possible, using integers only.
An example: where $n=50$, $a=9$, $b=7$, and $c=4$, $a(4)+b(2)+c(0)=n$ is a better solution than $a(2)+b(4)+c(1)=n$, because $4+2+0<2+4+1$.
EDIT: All integers are to be non-negative. An easy real-world example would be making change - it's ideal to use the least possible number of coins to deliver the required sum. These are the types of problems I am trying to figure out how to solve; I have several, with different values for all given variables.
Is there some way to calculate this, or do I just need to attempt to noodle out all of my solutions? TIA!