Comments

"The more choices we have, the better solution we may get". Here we are making a greedy move. What is the intution/logic/proof behind it?

We can simply take minimal dpm+m instead of maximal a[i]. But why it is optimal to move to cell with maximal a[i]?

No detailed editorial will be there but some rough sketchline on the solution will be posted and you can ask your doubts on open discussion forum.

Honestly we can't gaurantee delivery of prizes for non-Indians hence the condition....but I'm sure you can find some interesting problem( probably solving from hardest problem to easiest :D )

nice idea for a contest...although it can be hacked easily :)

I agree on that but here my extrema forms a continuos range so it still got the property of being convex function....I thought there maybe some trick existing for it.

Can div2 D be solved using ternary search....basically we can divide m units into x and m-x...x units to improve minimum skill level and m-x units to perfect some skills....I have implemented it here 15405049 but its getting wa because my function over which I ternary search is not strictly inc/dec... I know its a overkill for this ques but for future reference is there someway around it( ternary search on func which is not strictly inc/dec )?

In div1 C why do we need to add points (max(a[i]), 0) and (0, max(b[i])) to our set of points? If I'm not wrong, is this done to ensure that our ray definitely intersect with our convex hull?