Proof of solution of Problem 700B connesting universities?

Revision en1, by spirited_away_, 2019-08-30 03:04:45

Can anyone give me more detail proof of why the answer to the problem is always summation of min(S[v], 2*k - S[v]).

The editorial is not clear.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English spirited_away_ 2019-08-30 03:05:56 68
en2 English spirited_away_ 2019-08-30 03:05:01 2
en1 English spirited_away_ 2019-08-30 03:04:45 249 Initial revision (published)