#include using namespace std; #define rep(i, n) for(int i=0; i #include //vectorの中身を空白区切りで出力 template void printv(vector v) { for (int i = 0; i < v.size(); i++) { cout << v[i]; if (i < v.size() - 1) { cout << " "; } } cout << endl; } //vectorの中身を改行区切りで出力 template void print1(vector v) { for (auto x : v) { cout << x << endl; } } //二次元配列を出力 template void printvv(vector> vv) { for (vector v : vv) { printv(v); } } //vectorを降順にソート template void rsort(vector& v) { sort(v.begin(), v.end()); reverse(v.begin(), v.end()); } //昇順priority_queueを召喚 template struct rpriority_queue { priority_queue, greater> pq; void push(T x) { pq.push(x); } void pop() { pq.pop(); } T top() { return pq.top(); } size_t size() { return pq.size(); } bool empty() { return pq.empty(); } }; //mod mod下で逆元を算出する //高速a^n計算(mod ver.) ll power(ll a, ll n) { if (n == 0) { return 1; } else if (n % 2 == 0) { ll x = power(a, n / 2); x *= x; x %= mod; return x; } else { ll x = power(a, n - 1); x *= a; x %= mod; return x; } } //フェルマーの小定理を利用 ll modinv(ll p) { return power(p, mod - 2) % mod; } //Mexを求める struct Mex { map mp; set s; Mex(int Max) { for (int i = 0; i <= Max; i++) { s.insert(i); } } int _mex = 0; void Input(int x) { mp[x]++; s.erase(x); if (_mex == x) { _mex = *begin(s); } } void Remove(int x) { if (mp[x] == 0) { cout << "Mex ERROR!: NO VALUE WILL BE REMOVED" << endl; } mp[x]--; if (mp[x] == 0) { s.insert(x); if (*begin(s) == x) { _mex = x; } } } int mex(){ return _mex; } }; int main() { int N, M; cin >> N >> M; vector> path(N); rep(i, M) { int u, v; cin >> u >> v; u--; v--; path[u].push_back(v); path[v].push_back(u); } set enter; enter.insert(0); vector> q(N+1); q[0].push_back(0); set odd, even; even.insert(0); rep(t, N) { for (int x : q[t]) { for (int y : path[x]) { if (!enter.count(y)) { enter.insert(y); if (t % 2 == 0) { odd.insert(y); } else { even.insert(y); } q[t + 1].push_back(y); } } } if (t % 2 == 0) { cout << odd.size() << endl; } else { cout << even.size() << endl; } } }