#include "bits/stdc++.h" using namespace std; typedef long long ll; #define rep(i,l,r) for(int i=(l);i<(r);i++) #define fcout cout << fixed << setprecision(10) vector factn; array fact; array, 100001> mem; int n; pair ans(int m, int k, int cnt, int at){ if(!k){ if(!mem[cnt].first){ int mn, mx = 0; for(int i = cnt ; i < n ; i += cnt) if(mx < fact[i]){ mx = fact[i]; mn = i; } mem[cnt] = make_pair(mx, mn); } return mem[cnt]; } if(m == k) return ans(m - 1, k - 1, cnt * factn[at], at + 1); auto a = ans(m - 1, k - 1, cnt * factn[at], at + 1); auto b = ans(m - 1, k, cnt, at + 1); if(a.first == b.first) return a.second < b.second ? a : b; return a.first > b.first ? a : b; } int main(){ int k; rep(i, 1, 100001){ for(int j = i ; j < 100001 ; j += i){ fact[j]++; } } cin >> n >> k; int a = n; for(int i = 2 ; ; i++){ while (fact.at(i) - 2) { i++; } if(a % i == 0){ a /= i; factn.push_back(i); if(fact[a] == 2){ factn.push_back(a); break; } i--; } } cout << ans(factn.size(), k, 1, 0).second << endl; }