#include <iostream>
#include <cmath>
using namespace std;
// zdefiniuj funkcję
int suma_dzielnikow(int n) {
int suma = n + 1;
for (int i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
suma += i;
if (i != n / i) suma += n / i;
}
}
return suma;
}
int main() {
// sprawdź działanie funkcji
cout << suma_dzielnikow(7) << " " << suma_dzielnikow(16) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgovLyB6ZGVmaW5pdWogZnVua2NqxJkKaW50IHN1bWFfZHppZWxuaWtvdyhpbnQgbikgewogICAgaW50IHN1bWEgPSBuICsgMTsKICAgIGZvciAoaW50IGkgPSAyOyBpIDw9IHNxcnQobik7IGkrKykgewogICAgICAgIGlmIChuICUgaSA9PSAwKSB7CiAgICAgICAgICAgICAgc3VtYSArPSBpOwogICAgICAgICAgICAgIGlmIChpICE9IG4gLyBpKSBzdW1hICs9IG4gLyBpOwogICAgICAgICAgICAgIH0KfQpyZXR1cm4gc3VtYTsKfQoKaW50IG1haW4oKSB7CiAgICAvLyBzcHJhd2TFuiBkemlhxYJhbmllIGZ1bmtjamkKICAgIGNvdXQgPDwgc3VtYV9kemllbG5pa293KDcpIDw8ICIgIiA8PCBzdW1hX2R6aWVsbmlrb3coMTYpIDw8IGVuZGw7CiAgICByZXR1cm4gMDsKfQ==