#include<iostream>
#include<stdio.h>
using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
int test;
int num;
int i;
int j;
int max;
int tem;
int h;
int are;
cin>>test;
while(test --)
{
max = ;
cin>>num;
for(h = ; h <= num; ++ h)
{
if(num%h == )
{
are = num/h;
for(i = ; i*i < are + ; ++ i)
{
if(are%i == )
{
j = are/i;
tem = *i*j + *i*h + *j*h;
if(tem < max)
max = tem;
}
}
}
}
cout<<max<<endl;
}
}
相关文章
- 01分数规划POJ3621(最优比例生成环)
- poj2488--A Knight's Journey(dfs,骑士问题)
- 【POJ3071】Football - 状态压缩+期望 DP
- poj1151 Atlantis (线段树+扫描线+离散化)
- 专题复习--背包问题+例题(HDU 2602 、POJ 2063、 POJ 1787、 UVA 674 、UVA 147)
- poj 2591 Set Definition
- How Many Tables(POJ 1213 求连通分量)
- POJ 2289 最大流
- Destroying The Graph(poj 2125)
- POJ 1146 ID Codes 用字典序思想生成下一个排列组合