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