Comments

I did it in (max value of ki + size of string ti corresponding to it)*log(sum of all Ki)

-10

Strange! My C++ code got accepted with printf but got TLE with cout. This is too harsh

Is there any more intuitive approach for the problem D. I find it very difficult to come up with such a solution during the contest. Thanks for your help in advance!

+19

When will be the editorial uploaded?