Somehow I can't think of the solution which is probably simple once mentioned.
So I need to make a program where I need to divide in equal parts.
given:
- 5 types of classes (say mechanics, it, management etc)
- 400 students
- each class can contain a max of 32 students
Now I need to equally divide the 400 students over those classes. So that would mean 400 / 5 = 80 per type of class
So 80 students for mechanics for example divided in equal groups as much as possible so 3 groups of 27 - 27 - 26 students.
The number of students can differ so it needs to calculate that automatically.
another example: 200 students / 5 is 40 so 1 type of class has 2 groups of 20 students..
If someone can explain me that in pseudocode I would be thankfull!