For example, say I enter \'10\' for the amount of values, and \'10000\' as a total amount.
The script would need to randomize 10 different numbers that all equal up
Generate 10 random numbers till 10000 . Sort them from big to small : g0 to g9
g0 = 10000 - r0 g1 = r0 - r1 ... g8 = r8 - r9 g9 = r9
This will yield 10 random numbers over the full range which add up to 10000.