The students bought 3 + 4 + 5 + 3 + 5 cups altogether, and we want to distribute those evenly. We could add them up and do division, or we could just shift some cups around. If we take a cup away from each of the 5-cup portions and add it to each of the 3-cup portions, the sum now looks like
(3 + 1) + 4 + (5 - 1) + (3 + 1) + (5 - 1)
or, simplifying:
4 + 4 + 4 + 4 + 4
Everyone's got the same amount of sugar now, and that amount is 4 cups.