Fitting number of balls inside a cube

Job ID: 32587354

Budget: $10 – $70 CAD

I need either a python or MATLAB code to find the position of the balls inside the cube. Balls should be randomly distributed in the cube without any interface with each other or the cube (see the attached picture).

Inputs and outputs should be like below:

Inputs:
1. Packing factor (packing factor is the total volume of the balls over the volume of the cube)
2. dimension of the cube (L*L*L; L is the length of the cube)
3. minimum and maximum radius of the balls

Outputs (should be saved in the txt file - see the sample as attached):
- Position of the balls (in the X, Y and Z direction)
- radius of the balls

The code should works for the following conditions:
1. Any dimension of the cube and balls
2. 0<=packing factor<=0.6

If you can do this project, please first send me a sample txt file (similar to the attached sample) for the following example:
inputs:
1. Packing factor=0.6
2. L=10
3. minimum radius of the balls=0.9 ; maximum radius of the balls=0.95