Hi,
Let's say I have 7092 apples and I want to separate the 7092 apples evenly to 8 baskets. Unfortunately, 7092/8 is 886.5 which is not possible. Hence the next best way (first scenario) is to give 886 apples to the first 7 baskets each, and the last one to have 890 apples.
However, this is still not the best way to separately the apples evenly. An even better way (second scenario) would be to give the first 4 baskets 887 apples, and the last 4 baskets to have 886 apples each.
So how will the pseudo-code look like for the second scenario?
Thanks in advance.
Regards,
TM
Let's say I have 7092 apples and I want to separate the 7092 apples evenly to 8 baskets. Unfortunately, 7092/8 is 886.5 which is not possible. Hence the next best way (first scenario) is to give 886 apples to the first 7 baskets each, and the last one to have 890 apples.
However, this is still not the best way to separately the apples evenly. An even better way (second scenario) would be to give the first 4 baskets 887 apples, and the last 4 baskets to have 886 apples each.
So how will the pseudo-code look like for the second scenario?
Thanks in advance.
Regards,
TM