Trees https://atcoder.jp/contests/agc001/tasks/agc001_c

what to do next after finding diameter couldnot figure out