PersonalCorpus 版 (精华区)
1121753 2002/09/27 05:12:49.657 Accepted
0:00.000 64 18188 C++ 10365 - Blocks
void main()
{
#ifndef ONLINE_JUDGE
freopen("c:\\0acm\\uva\\contest9-21\\iD","r",stdin);
freopen("c:\\0acm\\uva\\contest9-21\\oD","w",stdout);
#endif
int i,j,k,n,t,best,now;
scanf("%d\n",&t);
while (t>0) {
t--;
scanf("%d\n",&n);
best=100000000;
for (i=1;i<=n;i++) if (n%i==0) {
n/=i;
for (j=i;j<=n;j++) if (n%j==0) {
k=n/j;
now=(i*(k+j)+k*j)*2;
if (now<best) best=now;
}
n*=i;
}
printf("%d\n",best);
}
}
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.775毫秒