CCCPaste

Untitled

#include 
#include 
#include 
#include 
using namespace std;
typedef long long ll;



int main() {
    ll x, n;
    cin >> x >> n;
    
    for(int i = 0; i < n; i++) {
        ll koren = sqrt(x);
        ll prv_delitel = 1;
        
        for(ll j = 2; j <= koren; j++) {
            if(x % j == 0) {
                prv_delitel = x / j;
                break;
            }
        }
        
        
        x += prv_delitel;
        
    }
    cout << x << endl;
    
    return 0;
}