Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <map>
- #include <set>
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement