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 <iostream>
#include <stdio.h>
using namespace std;
int main()
{
long long n,a[8],k,i,j;
scanf("%lld",&n);
for(k=1;k<=n;k++)
{
scanf("%lld%lld%lld",&a[1],&a[2],&a[3]);
if(!a[1]) printf("%lld\n",a[2]*a[2]+a[3]*a[3]);
else
{
for(i=1;i<=2;i++) for(j=i+1;j<=3;j++) if(a[i]>a[j])
{
a[i]=a[i]+a[j];a[j]=a[i]-a[j];a[i]=a[i]-a[j];
}
printf("%lld\n",a[1]*a[1]+a[2]*a[2]+a[3]*a[3]+2*a[1]*a[2]);
}
}
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... |