Ed55 C题 想的基本是正解(不正解在于明明sort就可以 却用了multiset)不明白哪里挂了 对数据也还没改出来
1082C - Multi-Subject Competition
At first, it's optimal to take candidates with maximal levels for a fixed subject.
At second, if we fix number of participants in each subject for some delegation, then it's always optimal to choose all subjects with positive sum of levels.
It leads us to a following solution. Let's divide all candidates by it's si
and sort each group in non-increasing order.
In result we can just iterate over all prefix sums for each group and update global answer of current length with current sum if it has a positive value.