#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #pragma warning(disable:4996) typedef long long ll; typedef unsigned long long ull; #define MIN(a, b) ((a)>(b)? (b): (a)) #define MAX(a, b) ((a)<(b)? (b): (a)) #define LINF 9223300000000000000 #define LINF2 1223300000000000000 #define INF 2140000000 const long long MOD = 1000000007; //const long long MOD = 998244353; using namespace std; vector pp; void preparePrime( int maxp ) { int i; vector a(maxp+1); for(i=2; i<=maxp; i++) { int k=i+i; while(k<=maxp) { a[k]=1; k+=i; } } for(i=2; i<=maxp; i++) { if(a[i]==0) pp.push_back( i ); } return; } void solve() { int n; scanf("%d", &n); if (n == 1) { printf("1\n"); return; } vector v; preparePrime(1000); int i,j; for (i = 100001; i < 100200; i++) { int flag = 0; for (j = 0; j < (int)pp.size(); j++) { if (i%pp[j] == 0) { flag = 1; break; } } if (flag == 0) { v.push_back(i); if ((int)v.size() == 5) break; } } set s; for (i = 0; i < 10; i++) { for (j = i; j < 10; j++) { s.insert(v[i] * v[j]); } } int cnt = 1; auto it = s.begin(); for (; it != s.end(); ++it) { cnt++; if (cnt == n) { printf("%lld\n", *it); return; } } return; } int main(int argc, char* argv[]) { #if 1 solve(); #else int T; scanf("%d", &T); int t; for(t=0; t