Is their a way to have a user input a number and to have that number be the size of an array and have it produce random numbers in the array that equal one number.

Lets say the user inputs 7

I am trying to figure a way to then make a function that takes that number then produce seven randomly selected numbers into an array that when added would equal a certaon number every time.

Lets say i want it to equal 50 it would produce the numbers 4, 7, 21, 8, 2, 3, 5. these add up to fifty. This is probably very confusing the way i described the problem but if you understand and know what i am talking about then your help would be greatly appreciated.

Thanks,

Nate