Advertisement
Josif_tepe

Untitled

Feb 3rd, 2024
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     long long x, n;
  8.     cin >> x >> n;
  9.    
  10.     for(int i = 0; i < n; i += 1) {
  11.         long long najgolem_delitel = 1;
  12.         for(long long j = 1; j < x; j += 1) {
  13.             if(x % j == 0) {
  14.                 najgolem_delitel = j;
  15.             }
  16.         }
  17.         x += najgolem_delitel;
  18.        
  19.     }
  20.     cout << x << endl;
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement