Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- long long x;
- cin >> x;
- int n;
- cin >> n;
- for(int i = 0; i < n; i++) {
- long long najgolem_delitel = 1;
- for(long long j = 2; j * j <= x; j++) {
- if(x % j == 0) {
- najgolem_delitel = x / j;
- break;
- }
- }
- x += najgolem_delitel;
- }
- cout << x << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement