#include <iostream>
using namespace std;
int main() {
int n,k;
cin >> n >> k;
int index = 0;
for (int i = 1;i <= n;i++) {
if (n % i == 0) {
index++;
if (index == k) {
cout << i;
return 0;
}
}
}
cout << 0;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: