给一个 nnn 个节点的树,每个点有点权 wiw_iwi,对于两个点 i,ji,ji,j,令 L=wi+wj+dist(i,j)L=w_i+w_j+dist(i,j)L=wi+wj+dist(i,j),求 LLL 的最大值。
时间复杂度越小越好。