python – How to add to each value of a list a number that depends on another random?

I have a list with 21 terms and a value ranging from 0 to a random number ranging from zero to the number entered by the user. I have to divide this random number into smaller numbers that add randomly, for example:

The random number generated was 100, I can divide the numbers 50, 25, 10, 15 (and 17 zeros), then add each part in a term of my choice in the list (it can not be random and ordered, it which is arbitrary)

The problem is that I do not know how to do that, I thought I'd make a for which contains a random number q goes from 0 to the number you typed, but do not even mount that, I know, any ideas?

(The schema would be in the form:

x = randint (0, pat) #pat is the variable entered by the user
x2 = randint (0, pat-x
x3 = randint (0, pat-x-x2

Up to (stalemate minus the variable gives zero), in which it would simply be repeated the number zero several times)