I'm trying to design an algorithm for evenly fitting decimal numbers into a decimal number.
Say I have a set $N$ of decimal numbers ($N_1$, $N_2$, ..., $N_n$) and a target value $Y$. I'd like to see what combination of values of $N$ (values may be used zero to many times) add up evenly to $Y$.
I've accomplished it by selecting random values of $N$ until I either add up to $Y$ or pass it - at which point I start over. This algorithm does not seem efficient, however. Sometimes it takes 50k passes before it lands on an answer.
The set I'm actually working with is 21 dollar values between \$0.89 and \$8.04 and the target is \$43.94.
Is there a simpler algorithm?