Router Mesh
题号:NC211810
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

In a Mesh networking system, there are MI Routers, where pairs of MI Routers are bidirectionally connected. In order to check the stability of the system, for each MI Router, we should determine the number of connected components after removing it and relative connections from the system. And then assess that if we should add more MI Routers into the system. Print the numbers of connected components in residual system after removing each MI Router.

输入描述:

The first line contains two integers , denoting the number of MI Routers and bidirectional connections in the Mesh networking system.

Following lines each contains two integers , denoting the -th MI Router has a bidirectional connection with the -th MI Router.

It's guaranteed that there are no duplicated connections in input.

输出描述:

Print one line containing  integers, where -th integer denotes the number of connected components after removing -th MI Router and relative connections.
示例1

输入

复制
4 2
1 2
1 3

输出

复制
3 2 2 1

说明

After removing the 1st MI Router and relative connections, there are 3_{} connected components: \{2\}, \{3\}, \{4\}_{}.
After removing the 2nd MI Router and relative connections, there are 2_{} connected components: \{1, 3\}, \{4\}_{}.
After removing the 3rd MI Router and relative connections, there are 2_{} connected components: \{1, 2\}, \{4\}_{}.
After removing the 4th MI Router and relative connections, there is only 1_{} connected component: \{1, 2, 3\}_{}.