#include<stdio.h>
#include<math.h>
int main()
{
int s;
scanf("%d",&s);
while(s--)
{
double a,b,c,d;
double x,y,t1,t2;
scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
x=(a+c)/2;
y=(b+d)/2;
t1=sqrt((x-a)*(x-a)+(y-b)*(y-b));
t2=sqrt((x-c)*(x-c)+(y-d)*(y-d));
printf("%.1lf\n",t1+t2);
}
return 0;
}
#include<math.h>
int main()
{
int s;
scanf("%d",&s);
while(s--)
{
double a,b,c,d;
double x,y,t1,t2;
scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
x=(a+c)/2;
y=(b+d)/2;
t1=sqrt((x-a)*(x-a)+(y-b)*(y-b));
t2=sqrt((x-c)*(x-c)+(y-d)*(y-d));
printf("%.1lf\n",t1+t2);
}
return 0;
}