#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int co[1000010] = {}, a[200020]; int d[1000010] = {}; int ans[200020] = {}; int main() { int n; cin >> n; int m = 0; for (int i = 0; i < n; i++) { cin >> a[i]; m = max(m, a[i]); d[a[i]]++; } int co1 = 0; for (int i = 2; i <= m; i++) { for (int j = i; j <= m; j += i) { co1++; co[i] += d[j]; } } for (int i = 2; i <= m; i++) { ans[min(n, co[i])] = i; } ans[n + 1] = 1; for (int i = n; i > 0; i--) { ans[i] = max(ans[i], ans[i + 1]); cout << ans[i] << endl; } }