#include<iostream> #include<stdio.h> using namespace std; int main() { //freopen("acm.acm","r",stdin); unsigned long a; unsigned long m; unsigned long n; unsigned long tem; cin>>a; tem = a*a + 1; for(m = a; m>=1 ; -- m) { if((a*a + 1)%m == 0) break; } n = tem/m; cout<<m+n+2*a<<endl; }
关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。
技术网站地址: vmfor.com