#include using namespace std; #define lint long long #define P pair #define LLP pair #define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i) #define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i) #define reps(i, n) for(int i = 1, i##_len = (int)(n) ; i <= i##_len ; ++i) #define rrep(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i) #define rreps(i, n) for(int i = (int)(n) ; i > 0 ; --i) #define SORT(x) sort((x).begin(), (x).end()) #define SORT_INV(x) sort((x).rbegin(), (x).rend()) const int IINF = (1 << 30) - 1; const long long LLINF = 1LL << 61; const long long MOD = 1000000007LL; const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1}; const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1}; const double EPS = 1e-8; bool comp(P &a, P &b){ return a.second == b.second ? a.first < b.first : a.second > b.second; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int n, k; cin >> n >> k; vector< P > v; int m = n; for(int i = 2 ; i * i <= m ; ++i){ if(m % i == 0){ int cnt = 0; while(m % i == 0){ m /= i; ++cnt; } v.emplace_back(i, cnt); } } if(m > 1){ v.emplace_back(m, 1); } int siz = v.size(); vector< P > t; REP(i, 2, n){ int now = i, cnt = 0; rep(j, siz){ if(v[j].first > now){ break; } int tmp = 0; while(now % v[j].first == 0 && tmp < v[j].second){ now /= v[j].first; ++tmp; } cnt += tmp; } if(cnt < k){ continue; } cnt = 0; for(int j = 1 ; j * j <= i ; ++j){ if(i % j == 0){ cnt += 2; } } t.emplace_back(i, cnt); } sort(t.begin(), t.end(), comp); cout << t[0].first << endl; return 0; }