An efficient solution will be to run a binary search on output. We will run binary search on how many topics each student will get and get the optimized result.

There may be other valid solutions to this problem.

An efficient solution will be to run a binary search on output. We will run binary search on how many topics each student will get and get the optimized result.

There may be other valid solutions to this problem.

61% Solution Ratio

nahid08Earliest,

Nahid001Fastest, 0.1s

sakib_muhitLightest, 393 kB

tahsin_protikShortest, 501B