#include #define FASTIO using namespace std; using ll = long long; using Vi = vector; using Vl = vector; using Pii = pair; using Pll = pair; constexpr int I_INF = numeric_limits::max(); constexpr ll L_INF = numeric_limits::max(); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void solve() { ll N; cin >> N; Vl ps; for (ll x = 100001;; x++) { bool ok = true; for (ll y = 2; y * y <= x; y++) { if (x % y == 0) { ok = false; break; } } if (ok) { ps.emplace_back(x); } if (ps.size() == 10) { break; } } Vl vs; for (ll i = 0; i < 10; i++) { for (ll j = i; j < 10; j++) { vs.emplace_back(ps[i] * ps[j]); } } sort(vs.begin(), vs.end()); if (N == 1) { cout << 1 << endl; } else { cout << vs[N - 2] << endl; } } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% int main() { #ifdef FASTIO cin.tie(0), cout.tie(0); ios::sync_with_stdio(false); #endif #ifdef FILEINPUT ifstream ifs("./in_out/input.txt"); cin.rdbuf(ifs.rdbuf()); #endif #ifdef FILEOUTPUT ofstream ofs("./in_out/output.txt"); cout.rdbuf(ofs.rdbuf()); #endif solve(); cout << flush; return 0; }