#include #include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) template bool chmin(T &x, T y) { return x > y ? (x = y, true) : false; } template bool chmax(T &x, T y) { return x < y ? (x = y, true) : false; } struct io_setup { io_setup() { ios::sync_with_stdio(false); std::cin.tie(nullptr); cout << fixed << setprecision(15); } } io_setup; int main(){ int n,m; cin>>n>>m; vector> g(n); rep(i,0,m){ int a,b; cin>>a>>b; a--; b--; g.at(a).push_back(b); g.at(b).push_back(a); } vector sm(n+1,0); queue> q; q.push({0,0}); vector stl(n,0); while(!q.empty()){ auto[nw,h]=q.front(); q.pop(); if(stl.at(nw)) continue; stl.at(nw)=1; sm.at(h)++; for(int nx:g.at(nw)){ if(stl.at(nx)) continue; q.push({nx,h+1}); } } int nw1=0,nw2=(sm.at(1)>0?1:0); rep(i,1,n+1){ nw1+=sm.at(i); cout<