I'm sure this is something that I should be able to google but for some reason, I just can't structure my question properly...
Basically: Given a set of size N, I need to generate numbers between A and B and ensure that the resulting sum of the set falls between X and Y.
For example: Generate 3 numbers between 0 and 1 such that the sum falls between 2.4 and 3.
I've figured out that I need to generate random numbers between MIN and MAX and each step, I need to recalculate MIN (depending on choices made and amount of numbers left in the set)...but this is honestly starting to feel like a wasted effort after a few hours of struggling.
I'm not really expecting an answer here (definitely not expecting someone to write the algorithm) but I'm hoping someone can point me in the direction of other problems that I can read about that might jostle something in my head.