标签:
Description
Input
Output
Sample Input
Sample Output
1 #include<iostream> 2 #include<cmath> 3 using namespace std; 4 int main(){ 5 int t;cin>>t; 6 while(t--){ 7 int n;cin>>n; 8 int m=floor(sqrt(n)+0.5); 9 int sum=0; 10 for(int i=m;i>0;i--){ 11 if(n%i==0){ 12 sum=max((i+n/i)*2,sum); 13 break; 14 } 15 } 16 cout<<sum<<endl; 17 } 18 return 0; 19 }
标签:
原文地址:http://www.cnblogs.com/demodemo/p/4696610.html