problem B of last contest HELP !

Revision en1, by SuperMo, 2024-07-01 23:06:49

Hi in problem B of last contest the answer is ∑(pi−ai)+max(pi−ai) now I don't get the max(pi−ai) part I know what it's but I don't know how did we derive it can someone help ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English SuperMo 2024-07-01 23:06:49 216 Initial revision (published)