Good evening,
I've been doing some research for school and already tried some ways for this to work. I've also searched this in my math books.
Here is the problem.
Let's say I have a number N of bottles, a number K of containers. Each container can have a different capacity (how many bottles can fit into a container). Considering that all the bottles have to be put into recipients, I have to calculate the total number of possibilities of putting the bottles into containers. A solution is given when all the bottles are in the containers.
A concretely example: N=7 (7 bottles) K=2 (2 containers)
K1=3 (in container 1 fit in 3 bottles) K2=5 (in container 2 fit in 5 bottles)
The number of solutions for this example is : 2 Solution 1 : 3 4 (first container has 3 bottles , the other one has 4) Solution 2 : 2 5 (first container has 2 bottles , the other one has 5)
I need something that works for any number of bottles and containers. A formula, a source code in Java/C++. Any answer is welcomed.
More examples : 1. N=100 K=4 K1=25 K2=60 K3=100 K4=200 2. N=20 K=6 K1=10 K2=100 K3=1000 K4=2500 K5= 20 K6 =10