There are
Sometimes, beavers living in some islands gather in an island, and have a meeting. When the attendees of a meeting are fixed, one of the islands satisfying the following condition is chosen as the location of the meeting:
The sum of the numbers of bridges the attendees have to pass through to gather in the chosen island is minimized.
Here, when the attendees of a meeting are fixed, each attendee of the meeting moves from their island of residence to the location of the meeting by passing through the minimum number of bridges.
The attendees of a meeting are looking forward to it very much if there are many candidates for the location
of the meeting. When the attendees of a meeting are fixed, the expectation score of the meeting is calculated as
the number of candidate islands for the location of the meeting satisfying the above condition. For each integer
Write a program which, given the information of the islands, calculates, for each number of attendees, the maximum expectation score of a meeting.
Input Specification
Read the following data from the standard input. Given values are all integers.
Output Specification
Write
Constraints
. ( ). ( ). ( ).- It is possible to travel between any islands using some bridges.
Subtasks
- (4 points)
. - (16 points)
. - (80 points) No additional constraints.
Sample Input 1
5
1 2
2 3
4 2
3 5
Sample Output 1
1
4
1
2
1
Explanation for Sample 1
For example, we consider a meeting where the beaver in the island
- If they gather in the island
, the the beaver in the island does not pass through bridges, and the beaver in the island has to pass through bridges. The sum is . - If they gather in the island
, the sum of the numbers of bridges they have to pass through is . - If they gather in the island
, the sum of the numbers of bridges they have to pass through is . - If they gather in the island
, the sum of the numbers of bridges they have to pass through is . - If they gather in the island
, the sum of the numbers of bridges they have to pass through is .
The candidates for the location of the meeting are the islands
Sample Input 2
7
1 2
2 3
3 4
4 5
2 6
3 7
Sample Output 2
1
5
1
3
1
2
1
Comments