#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
class CPoint{
private:
double x, y;
public:
CPoint(double p = 0,double q = 0) : x(p), y(q){};
double operator-(const CPoint &other) const{
return sqrt(pow(x - other.x, 2) + pow(y - other.y, 2));
}
};
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int m;
cout << fixed << setprecision(2);
while(cin >> m){
for(int i = 0; i < m; i++){
double ax, ay, bx, by;
cin >> ax >> ay >> bx >> by;
CPoint a(ax, ay);
CPoint b(bx, by);
cout << a - b << "\n";
}
}
return 0;
}