Triples of Cows

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

There are initially N1N-1 pairs of friends among FJ's NN (2N21052\le N\le 2\cdot 10^5) cows labeled 1N1\dots N, forming a tree. The cows are leaving the farm for vacation one by one. On day ii, the iith cow leaves the farm, and then all pairs of the iith cow's friends still present on the farm become friends.

For each ii from 11 to NN, just before the iith cow leaves, how many ordered triples of distinct cows (a,b,c)(a,b,c) are there such that none of a,b,ca,b,c are on vacation, aa is friends with bb, and bb is friends with cc?

입력

The first line contains NN.

The next N1N-1 lines contain two integers u_iu\_i and v_iv\_i denoting that cows u_iu\_i and v_iv\_i are initially friends (1u_i,v_iN1\le u\_i,v\_i\le N).

출력

The answers for ii from 11 to NN on separate lines.