I have an equation $x = 3a+4b+2c+4d$, where $a$, $b$, $c$ and $d$ are nonnegative integers such that $a+b+c+d=5$.What algorithm can I use to calculate maximum value of $x$?
Partitioning a Number on the basis of an equation
algorithms