int a[2d5],b[],s[];{graph g;ll@n,@q,r=0;rd((a--,b--)(n-1));g.setEdge(n,n-1,a,b);g.SubTreeSize(0,s);rep(q){ll@p,@x;wt(r+=s[p-1]*x);}}