Problem 2929 · Medium

Distribute Candies Among Children II

Count the splits with inclusion-exclusion: all nonnegative triples minus those where one child exceeds the limit, added back in pairs.

Open the interactive visualisation