graph g;int n,a[2d5],b[2d5];{rd(n,(a--,b--)(n-1));g.setEdge(n,n-1,a,b);g.SubTreeSize(0,b);rep(i,n){ll r=(ll)b[i]**2;rep[g.edge[i]](j,g.es[i])r-=b[j]