-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path10365.cpp
29 lines (29 loc) · 917 Bytes
/
10365.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
int test;
scanf("%d",&test);
while(test--){
int n,i,j,k,area=1000000000;
scanf("%d",&n);
for(i=1;i<=n;i++){
for(j=1;j<=n;j++){
if(i*j>n)
break;
for(k=1;k<=n;k++){
if(i*j*k>n)
break;
if(i*j*k==n){
int temp=2*(i*j+j*k+k*i);
area=area<=temp?area:temp;
}
}
}
}
printf("%d\n",area);
}
return 0;
}