#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int gcd(int a, int b){ while(b != 0){ int tmp = a % b; a = b; b = tmp; } return a; } void integerFactorization(int n, vector >& factor) { factor.clear(); int a = 2; while(a * a <= n){ int b = 0; while(n % a == 0){ ++ b; n /= a; } if(b > 0) factor.push_back(make_pair(a, b)); ++ a; } if(n > 1) factor.push_back(make_pair(n, 1)); } int solve(int x, int n, int k) { int y = gcd(x, n); vector > f; integerFactorization(y, f); for(const auto& p : f) k -= p.second; if(k > 0) return -1; integerFactorization(x, f); int ans = 1; for(const auto& p : f) ans *= p.second + 1; return ans; } int main() { int n, k; cin >> n >> k; int maxCnt = -1; int ans = -1; for(int x=1; x