HDU4247【瞎搞】

题意:

给你4个小正方形的边长,让你求一个最小大正方形的边长以至于可以存这么四个正方形。

思路:

比划了一下。。。就是最大边+次大边,因为他们一定有交集。

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;

typedef long long LL;

LL a[4];
LL bian[20];

int main()
{
    int cas=1;
    while(~scanf("%lld%lld%lld%lld",&a[0],&a[1],&a[2],&a[3]))
    {
        sort(a,a+4);
        printf("Case %d: ",cas++);
        printf("%lld\n",a[2]+a[3]);
        
    }
    return 0;
}


posted @ 2016-10-15 22:20  see_you_later  阅读(98)  评论(0编辑  收藏  举报