If I have two numbers $x$ and $y$, how do I find the smallest value of $ax + by$, where $a$ and $b$ are integers, such that $ax + by$ is still larger than another number $z$?
For example, imagine I have two types of drug vials, one holds 20mg and the other 50mg. How do I find the combination of these vials so that I have enough drug for some who needs, say, 80mg of drug, whilst minimizing waste?
I can of course do this specific example in my hand, but I need a generalizable algorithm that I can code into Python eventually. Thank you so much!