Comments

I got 3 penalty for this one

Can anyone explain problem E i have doubt how we find r[0] as we have to sum over all r[i] and once we find r[0] all other expressions depends on r[0] only and if I want to find r[0] by traverse from 0 to 10^9(M) then it's gave me TLE also I find that we can build a function and here only one variable is r[0] and then I have to check whether this function gave us maximum but how to implement I have no idea.

yes i am waiting for when we submit the solution for problem

also i have implemented DP solution but 4 minutes after contest