#include using namespace std; using ll = long long; using P = pair; #define rep(i, a, b) for(ll i = a; i < b; ++i) #define rrep(i, a, b) for(ll i = a; i >= b; --i) constexpr ll inf = 4e18; struct SetupIO { SetupIO() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(30); } } setup_io; template struct Edge { int from, to; T cost; int idx; Edge() : from(-1), to(-1), cost(-1), idx(-1) {} Edge(int from, int to, const T& cost = 1, int idx = -1) : from(from), to(to), cost(cost), idx(idx) {} operator int() const { return to; } }; template struct Graph { Graph(int N) : n(N), es(0), g(N) {} int size() const { return n; } int edge_size() const { return es; } void add_edge(int from, int to, const T& cost = 1) { assert(0 <= from and from < n); assert(0 <= to and to < n); g[from].emplace_back(from, to, cost, es); g[to].emplace_back(to, from, cost, es++); } void add_directed_edge(int from, int to, const T& cost = 1) { assert(0 <= from and from < n); assert(0 <= to and to < n); g[from].emplace_back(from, to, cost, es++); } inline vector>& operator[](const int& k) { assert(0 <= k and k < n); return g[k]; } inline const vector>& operator[](const int& k) const { assert(0 <= k and k < n); return g[k]; } private: int n, es; vector>> g; }; template using Edges = vector>; template vector> dijkstra(const Graph& g, const int s = 0) { const int n = g.size(); assert(0 <= s and s < n); vector> d(n, {numeric_limits::max(), -1}); priority_queue, vector>, greater>> pq; d[s] = {0, -1}; pq.emplace(0, s); while(!pq.empty()) { const auto [dist, cur] = pq.top(); pq.pop(); if(d[cur].first < dist) continue; for(const Edge& e : g[cur]) { if(d[e.to].first > d[cur].first + e.cost) { d[e.to] = {d[cur].first + e.cost, cur}; pq.emplace(d[e.to].first, e.to); } } } return d; } int main(void) { int n, m; cin >> n >> m; Graph g(n); rep(i, 0, m) { int u, v; cin >> u >> v; u--; v--; g.add_edge(u, v); } vector> d = dijkstra(g, 0); vector ans(n + 1); int cnt = 0; rep(i, 0, n) { if(d[i].first == numeric_limits::max()) continue; ans[d[i].first]++; cnt++; } if(cnt == 1) { rep(i, 1, n + 1) { cout << 0 << '\n'; } return 0; } rep(i, 1, n + 1) { if(i >= 2) { ans[i] += ans[i - 2]; } cout << ans[i] << '\n'; } }