There are N buckets B1, B2, B3 , ..., BN having their respective capacity C1, C2, C3, ..., CN
There are 2 colored balls of different sizes : Red & Blue balls
The buckets are filled with various different balls -> Some buckets can have mix of both balls, some of only one color. The buckets may be un-even filled to their capacity (Some filled upto 10% of their capacity, but others may be filled to 90% of their capacity as an example)
The task is to evenly fill the buckets with different color balls. ie. ratio of (total size occupied by red ball / total capacity of the bucket) is as even as possible across buckets. Similarly for blue colored ball.