Algoritm to distribute/spread X amount of "classes" on X amount of "rounds"
I'm having trouble solving this problem. <br>
An example would be to imagine 3 div containers (soccer-classes, Like boys 8 years, girls 9 years and so on) above each other. <br>The div containers is supposed to be equal in width (games per round, in this example 3 games pr round, but can be any number.), but they have different height (games per class, in this example one class has 15, another 25 another 50). <br>
I would like to be able to spread the games over the total amount of rounds in an "even" fashion. <br>I most certainly would like to avoid "class boys 8 years" to play all games in consecutive rounds, then "girls 9" and then the third class. <p>As the number of games and classes varies the solution must handle all possible combinations.<p> If anyone can point to any helpful links on the internet that might help solve this, or anyone simply has a solution ready please step forward.<p> Hope someone can help with this. regards Roar
Algoritm to distribute/spread X amount of "classes" on X amount of "rounds"
===

I'm having trouble solving this problem. <br>
An example would be to imagine 3 div containers (soccer-classes, Like boys 8 years, girls 9 years and so on) above each other. <br>The div containers is supposed to be equal in width (games per round, in this example 3 games pr round, but can be any number.), but they have different height (games per class, in this example one class has 15, another 25 another 50). <br>
I would like to be able to spread the games over the total amount of rounds in an "even" fashion. <br>I most certainly would like to avoid "class boys 8 years" to play all games in consecutive rounds, then "girls 9" and then the third class. <p>As the number of games and classes varies the solution must handle all possible combinations.<p> If anyone can point to any helpful links on the internet that might help solve this, or anyone simply has a solution ready please step forward.<p> Hope someone can help with this. regards Roar