Ti-am facut o sursa in C++. Succes!
#include <iostream>
using namespace std;
int n, d;
double ma, s, nr;
int main()
{
cin >> n;
for(d = 1; d * d < n; d ++)
if(n % d == 0)
{
s = s + d + n / d;
nr = nr + 2;
}
if(d * d == n)
{
s = s + d;
nr = nr + 1;
}
ma = s/nr;
cout << ma;
return 0;
}