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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |