#include int main(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int N, M; std::cin >> N >> M; std::vector> G(N + 1); for(int i=0;i> u >> v; G[u].emplace_back(v); G[v].emplace_back(u); } std::queue queue; std::vector dist(N + 1, -1); queue.emplace(1); dist[1] = 0; while(!queue.empty()){ int v = queue.front(); queue.pop(); for(int w : G[v]){ if(dist[w] == -1){ queue.emplace(w); dist[w] = dist[v] + 1; } } } std::vector count(N + 1, 0); for(int i=1;i<=N;i++){ if(dist[i] != -1){ count[dist[i]] += 1; } } if(count[1] == 0){ for(int i=1;i<=N;i++){ std::cout << 0 << std::endl; } return 0; } int count_even = 1, count_odd = 0; for(int i=1;i<=N;i++){ if(i % 2 == 1){ count_odd += count[i]; std::cout << count_odd << std::endl; }else{ count_even += count[i]; std::cout << count_even << std::endl; } } }