// editor1
#include<stdio.h>
int main (){
    int n;
    if (scanf("%d", &n) != 1){
        printf("Invalid input\n");
        return 0;
    }
    if (n<0){
        printf("Invalid input\n");
        return 0;
    }
    for (int i = 0; i < n ; i++){
        double x1, y1, x2, y2;
        if (scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2) == 4){
            double dist = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
            printf("%.2f\n",dist);
        } else {
            printf("Invalid input\n");
            return 0;
        }
    }
    return 0;
}