Hello Codeforces Community,
I found this problem very interesting, but couldn't solve it. Also the editorial wasn't clear to me. What I was trying was a greedy solution that passed half of the test cases.
Problem Tags: Trees, dsu
Could someone explain it in a better way?
Thanks!