#include using namespace std; int N; vector A; vector F; int func(int k) { int ans = 0; int cnt = 0; vector history; for (int a : A) { if (!F[a-1]) { if (cnt == k) { ans++; while (!history.empty()) { F[history.back()] = false; history.pop_back(); } cnt = 0; } cnt++; F[a-1] = true; history.push_back(a-1); } } while (!history.empty()) { F[history.back()] = false; history.pop_back(); } return ans + 1; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N; A.resize(N); for (int i = 0; i < N; i++) cin >> A[i]; if (N == 1) { cout << 1 << "\n"; return 0; } F.assign(N, false); int route = (int)(pow(N, 0.6)) + 1; vector ans; for (int k = 1; k <= route; k++) { ans.push_back(func(k)); } int left = route; while (left <= N) { int now = ans.back(); int idx = (int)ans.size(); int right = N + 1; while (left + 1 < right) { int mid = (left + right) / 2; if (func(mid) == now) { left = mid; } else { right = mid; } } for (int i = 0; i < right - idx - 1; i++) { ans.push_back(now); } if (right <= N) { ans.push_back(func(right)); } left = right; } for (int a : ans) { cout << a << "\n"; } return 0; }