#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;cin>>n;
    while(n--){
        int a,b,c,d,e,f;
        cin>>a>>b;
        cin>>c>>d;
        cin>>e>>f;
        //计算三条边
        double d1 = sqrt((pow(a-c,2))+(pow(d-b,2)));
        double d2 = sqrt((pow(a-e,2))+(pow(f-b,2)));
        double d3 = sqrt((pow(e-c,2))+(pow(d-f,2)));
        vector<double>v;
        v.push_back(d1);v.push_back(d2);v.push_back(d3);
        sort(v.begin(),v.end());
        if(pow(v[0],2)+pow(v[1],2) == pow(v[2],2)){
            cout<<"Yes"<<endl;
        }else {
            cout<<"No"<<endl;
        }
        cout<<fixed<<setprecision(2)<<d1+d2+d3<<endl;
    }
}
// 64 位输出请用 printf("%lld")

勾股定理