# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
2371 | swh0329 | 개미 (GA4_ant) | C++98 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#define Min(x,y) x<y?x:y
using namespace std;
int main()
{
int t;
int a, b, c, m;
scanf("%d", &t);
while(t>0)
{
t--;
m=999999;
scanf("%d %d %d", &a, &b, &c);
m=Min(m, (a+b)*(a+b)+(c*c));
m=Min(m, (a+c)*(a+c)+(b*b));
m=Min(m, (a*a)+(b+c)*(b+c);
m+=c;
printf("%d\n", m);
}
return 0;
}