markdown 在线制作ppt json校验和格式化工具

POJ 2363

#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 = 100000000;
        cin>>num;
        for(h = 1; h <= num; ++ h)
        {
            if(num%h == 0)
            {
                are = num/h;
                for(i = 1; i*i < are + 1; ++ i)
                {
                    if(are%i == 0)
                    {
                        j = are/i;
                        tem = 2*i*j + 2*i*h + 2*j*h;
                        if(tem < max)
                            max = tem;
                    }
                }
            }
        }
        cout<<max<<endl;
    }
}

 

posted @ 2015-06-11 10:50  GavinHacker  阅读(117)  评论(0编辑  收藏  举报
markdown 在线制作ppt json校验和格式化工具