$21$ bandits live in the city of Warmridge, each of them having some enemies among the others. Initially each bandit has $240$ bullets, and duels with all of his enemies. Every bandit distributes his bullets evenly between his enemies, this means that he takes the same number of bullets to each of his duels, and uses each of his bullets in only one duel. In case the number of his bullets is not divisible by the number of his enemies, he takes as many bullets to each duel as possible, but takes the same number of bullets to every duel, so it is possible that in the end the bandit will have some remaining bullets. Shooting is banned in the city, therefore a duel consists only of comparing the number of bullets in the guns of the opponents, and the winner is whoever has more bullets. After the duel the sheriff takes the bullets of the winner and as an act of protest the loser shoots all of his bullets into the air. What is the largest possible number of bullets the sheriff can have after all of the duels have ended? Being someones enemy is mutual. If two opponents have the same number of bullets in their guns during a duel, then the sheriff takes the bullets of the bandit who has the wider hat among them. Example: If a bandit has $13$ enemies then he takes $18$ bullets with himself to each duel, and they will have $6$ leftover bullets after finishing all their duels.
Problem
Source: 2021 Dürer Math Competition Regional E5 E+2 https://artofproblemsolving.com/community/c2773609_2021_
Tags: combinatorics