#include using namespace std; int main() { vector V = {2, 3, 5, 7, 11, 13, 17}; vector P; for( int i = 0; i < 1<>j)&1) prod *= V[j]; } P.push_back(prod); } sort(P.rbegin(), P.rend()); int V_PROD = P.front(); vector A; for( int prod : P ) { long long c = 1; if(!A.empty()) { c = 1; for(;;c++) { bool divisible = false; for( int v : V ) divisible = divisible || c%v == 0; if(!divisible&&prod*c>A.back()) break; } } int n = A.size(); if(A.size()<=1||gcd(A[n-2], A[n-1])>gcd(A[n-1], prod*c)) A.push_back(prod*c); } int N; cin >> N; // for( int i = 0; i < N-1; i++ ) { // cerr << gcd(A[i], A[i+1]) << (i==N-2?"\n":" "); // } for( int i = 0; i < N; i++ ) { cout << A[i] << (i==N-1?"\n":" "); } } /* [2, 3, 5, 7, 11] 2, 3, 5, 7 2, 3, 5, 7 | 11 2, 3, 5, 7 | 13 *, 3, 5, 7 | 29 2, 3, 5, 7 | 17 2, *, 5, 7, 11 2, 3, 5, 7, 11 *, *, 5, 7, 11 2, 3, 5, 7, 11 2, 3, 5, *, 11 2, 3, 5, 7, 11 *, 3, *, 7, 11 2, 3, 5, 7, 11 *, 3, 5, *, 11 2, 3, 5, 7, 11 2, *, *, 7, 11 2, 3, 5, 7, 11 2, *, 5, *, 11 2, 3, 5, 7, 11 *, *, *, 7, 11 2, 3, 5, 7, 11 2, 3, *, *, 11 2, 3, 5, 7, 11 *, *, 5, *, 11 2, 3, 5, 7, 11 *, 3, *, *, 11 2 : 1 3 : 2 5 : 3 6 : 1 2 7 : 4 10 : 1 3 14 : 1 4 15 : 2 3 21 : 2 4 30 : 1 2 3 35 : 3 4 42 : 1 2 4 70 : 1 3 4 105 : 2 3 4 210 : 1 2 3 4 */