//The top program is in c++, the bottom one is in c. i have written mainly for c++ because the question fits the simpler topic of c++, this would be easy in c. to run the c program, simply delete the "/*" and the "*/" in the top and bottom of the c program.

#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
    int n;
    if(!(cin>>n)||n<=0||n>10)
    {
        cout<<"Invalid input";
        return 0;
    }
    for(int i=0;i<n;i++)
    {
        int x1,y1,x2,y2;
        if(!(cin>>x1>>y1>>x2>>y2))
        {
            cout<<"Invalid input";
            return 0;
        }
        if(x1<-1000||x1>1000||x2<-1000||x2>1000||y1<-1000||y1>1000||y2<-1000||y2>1000)
        {
            cout<<"Invalid input";
            return 0;
        }
        double dx=static_cast<double>(x2)-x1;
        double dy=static_cast<double>(y2)-y1;
        double d=sqrt((dx*dx)+(dy*dy));
        cout<<fixed<<setprecision(2)<<d;
        return 0;
    }
}

//the bottom program is in c,

/*
#include<stdio.h>
#include<math.h>
int main()
{
    int n;
    if(scanf("%d",&n)!=1||n<=0||n>10)
    {
        printf("Invalid input");
        return 0;
    }
    for(int i=0;i<n;++i)
    {
        int x1,y1,x2,y2;
        if(scanf("%d %d %d %d",&x1,&y1,&x2,&y2)!=4)
        {
            printf("Invalid input");
            return 0;
        }
        if(x1<-1000||x1>1000||x2<-1000||x2>1000||y1<-1000||y1>1000||y2<-1000||y2>1000)
        {
            printf("Invalid input");
            return 0;
        }
        double dx=(double)x2-x1;
        double dy=(double)y2-y1;
        double d=sqrt((dx*dx)+(dy*dy));
        printf("%.2f",d);
    }
    return 0;
}
*/