Total to share
Number of groups

Deal counters one at a time, like cards, so every group gets the same.

Total
Size of each group

Each time you take a group, you subtract. Count how many groups you can make.