Note is
not exact C # to give you this idea.
I think you are looking for a way to grammatically divide a number in different groups. Not knowing how large the groups are and the random number of groups.
so let's say x = 30 y = 15. 30/15 = 3 groups of 15 and let x = 43, so the number should look like? 14 14 15
groups (since you already have this calculated correctly)(should be a double)
membersPerGroup = floor(amount/groups)
List a = new List
leftover = amount%groups;
for(int i=0;i<groups;i++){
if(leftover>0){
a.Add(membersPerGroup +1);
leftover--;
}else{
a.Add(membersPerGroup );
}
}
#, ,