#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (b); i >= (a); i --)
#define REP(i, a) for (int i = 0; i < (a); ++i)
#define REPD(i, a) for (int i = (a) - 1; i >= 0; --i)
#define MASK(i) (1LL << (i))
#define BIT(x, i) (((x) >> (i)) & 1)
constexpr ll LINF = (1ll << 60);
constexpr int INF = (1ll << 30);
constexpr int Mod = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
/*
Phu Trong from Nguyen Tat Thanh High School for gifted student
*/
template <class X, class Y>
bool minimize(X &x, const Y &y){
X eps = 1e-9;
if (x > y + eps) {x = y; return 1;}
return 0;
}
template <class X, class Y>
bool maximize(X &x, const Y &y){
X eps = 1e-9;
if (x + eps < y) {x = y; return 1;}
return 0;
}
#define MAX 100005
int numNode;
int ans[MAX];
vector<int> G[MAX];
pair<int, int> dp[MAX];
void dfs(int u, int p, int length){
dp[u] = make_pair(0, 0);
int max_len[2];
max_len[0] = max_len[1] = 0;
for (int&v : G[u]) if(v ^ p){
dfs(v, u, length);
dp[u].first += dp[v].first;
if(dp[v].second > max_len[0]){
max_len[1] = max_len[0];
max_len[0] = dp[v].second;
}
else if(dp[v].second > max_len[1]){
max_len[1] = dp[v].second;
}
}
if(max_len[0] + 1 + max_len[1] >= length){
++dp[u].first;
dp[u].second = 0;
}
else{
dp[u].second = max_len[0] + 1;
}
}
void solve(int l, int r, int min_value, int max_value){
if (l > r) return;
if(min_value == max_value){
FOR(i, l, r) ans[i] = min_value;
return;
}
int m = (l + r) >> 1;
dfs(1, 1, m);
int res = dp[1].first;
ans[m] = res;
solve(l, m - 1, res, max_value);
solve(m + 1, r, min_value, res);
}
void process(void){
cin >> numNode;
for (int i = 1; i < numNode; ++i){
int u, v; cin >> u >> v;
G[u].emplace_back(v);
G[v].emplace_back(u);
}
solve(1, numNode, 0, numNode);
for (int i = 1; i <= numNode; ++i) cout << ans[i] << '\n';
}
signed main(){
#define name "Whisper"
cin.tie(nullptr) -> sync_with_stdio(false);
//freopen(name".inp", "r", stdin);
//freopen(name".out", "w", stdout);
process();
return (0 ^ 0);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwp1c2luZyBsbCA9IGxvbmcgbG9uZzsKCiNkZWZpbmUgaW50IGxvbmcgbG9uZwojZGVmaW5lIEZPUihpLCBhLCBiKSBmb3IgKGludCBpID0gKGEpOyBpIDw9IChiKTsgaSsrKQojZGVmaW5lIEZPUkQoaSwgYSwgYikgZm9yIChpbnQgaSA9IChiKTsgaSA+PSAoYSk7IGkgLS0pCiNkZWZpbmUgUkVQKGksIGEpIGZvciAoaW50IGkgPSAwOyBpIDwgKGEpOyArK2kpCiNkZWZpbmUgUkVQRChpLCBhKSBmb3IgKGludCBpID0gKGEpIC0gMTsgaSA+PSAwOyAtLWkpCgojZGVmaW5lIE1BU0soaSkgKDFMTCA8PCAoaSkpCiNkZWZpbmUgQklUKHgsIGkpICgoKHgpID4+IChpKSkgJiAxKQoKCmNvbnN0ZXhwciBsbCBMSU5GID0gKDFsbCA8PCA2MCk7CmNvbnN0ZXhwciBpbnQgSU5GID0gKDFsbCA8PCAzMCk7CmNvbnN0ZXhwciBpbnQgTW9kID0gMWU5ICsgNzsKbXQxOTkzNyBybmcoY2hyb25vOjpzdGVhZHlfY2xvY2s6Om5vdygpLnRpbWVfc2luY2VfZXBvY2goKS5jb3VudCgpKTsKCi8qCiAgICBQaHUgVHJvbmcgZnJvbSBOZ3V5ZW4gVGF0IFRoYW5oIEhpZ2ggU2Nob29sIGZvciBnaWZ0ZWQgc3R1ZGVudAoqLwoKdGVtcGxhdGUgPGNsYXNzIFgsIGNsYXNzIFk+CiAgICBib29sIG1pbmltaXplKFggJngsIGNvbnN0IFkgJnkpewogICAgICAgIFggZXBzID0gMWUtOTsKICAgICAgICBpZiAoeCA+IHkgKyBlcHMpIHt4ID0geTsgcmV0dXJuIDE7fQogICAgICAgIHJldHVybiAwOwogICAgfQoKdGVtcGxhdGUgPGNsYXNzIFgsIGNsYXNzIFk+CiAgICBib29sIG1heGltaXplKFggJngsIGNvbnN0IFkgJnkpewogICAgICAgIFggZXBzID0gMWUtOTsKICAgICAgICBpZiAoeCArIGVwcyA8IHkpIHt4ID0geTsgcmV0dXJuIDE7fQogICAgICAgIHJldHVybiAwOwogICAgfQojZGVmaW5lIE1BWCAgICAgICAgICAgICAgICAgMTAwMDA1CmludCBudW1Ob2RlOwppbnQgYW5zW01BWF07CnZlY3RvcjxpbnQ+IEdbTUFYXTsKCnBhaXI8aW50LCBpbnQ+IGRwW01BWF07Cgp2b2lkIGRmcyhpbnQgdSwgaW50IHAsIGludCBsZW5ndGgpewogICAgZHBbdV0gPSBtYWtlX3BhaXIoMCwgMCk7CiAgICBpbnQgbWF4X2xlblsyXTsKICAgIG1heF9sZW5bMF0gPSBtYXhfbGVuWzFdID0gMDsKICAgIGZvciAoaW50JnYgOiBHW3VdKSBpZih2IF4gcCl7CiAgICAgICAgZGZzKHYsIHUsIGxlbmd0aCk7CiAgICAgICAgZHBbdV0uZmlyc3QgKz0gZHBbdl0uZmlyc3Q7CiAgICAgICAgaWYoZHBbdl0uc2Vjb25kID4gbWF4X2xlblswXSl7CiAgICAgICAgICAgIG1heF9sZW5bMV0gPSBtYXhfbGVuWzBdOwogICAgICAgICAgICBtYXhfbGVuWzBdID0gZHBbdl0uc2Vjb25kOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmKGRwW3ZdLnNlY29uZCA+IG1heF9sZW5bMV0pewogICAgICAgICAgICBtYXhfbGVuWzFdID0gZHBbdl0uc2Vjb25kOwogICAgICAgIH0KICAgIH0KICAgIGlmKG1heF9sZW5bMF0gKyAxICsgbWF4X2xlblsxXSA+PSBsZW5ndGgpewogICAgICAgICsrZHBbdV0uZmlyc3Q7CiAgICAgICAgZHBbdV0uc2Vjb25kID0gMDsKICAgIH0KICAgIGVs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