Doubt in CODEFORCES 161D

Revision en1, by FineLine, 2016-06-04 09:09:30

__Hi everyone.I was trying to practice DP and then I encountered this question 161D - Расстояние в дереве.I have got the basic idea But I do not know how the editorialist gave the second recurrence relation. Can anyone please spare his precious time and help me regarding the same. Regards and Thanks in advance.

Tags dp, trees, recurrence

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English FineLine 2016-06-04 09:09:30 326 Initial revision (published)