I want to write a program, the program to randomly allocate five numbers, the five numbers must add up to 100. What is the calculation principle?

I want to write a program, the program to randomly allocate five numbers, the five numbers must add up to 100. What is the calculation principle?

The first four numbers are randomly assigned, and the fifth number = 100 minus the first four numbers