[cpp]
//---------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
//---------------------------------------------------------------------------
int main(int argc, char* argv[])
{
long L[3];
double s, a, h, d, dm, l1, l2;
register int i , casos;
register int e;
scanf("%d",&casos);
for (i = 0; i < casos; i++)
{
scanf("%ld%ld%ld",L,L+1,L+2);
s = (L[0] + L[1] + L[2]) / (double) 2.00;
a = sqrt(s * (s-L[0])*(s-L[1])*(s-L[2])); // area of triangle
dm = 0; // max side of square
for (e = 0; e < 3; e++)
{
// area = h * b / 2 => h = area * 2 / b
h = (a * 2.00) / (double) L[e]; // height of triangle L[e] is base
d = (L[e] * h) / (double)(L[e] + h); // d is side of square
l1 = sqrt((L[(e+1)%3] * L[(e+1)%3]) - (h * h));
l2 = sqrt((L[(e+2)%3] * L[(e+2)%3]) - (h * h));
if ((l1 <= L[e]) && (l2 <= L[e]) && (d >= dm)) dm = d;
}
printf("%.6lf\n",(dm*dm));
}
return 0;
}
//---------------------------------------------------------------------------
[/cpp]
Thanxxs
Schindler[/img]