#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;

int main() {
	int n;
	cin >> n;
	while (n) {
		int x1, y1, x2, y2,x3,y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		vector<double> v(3);
		v[0] = sqrt(pow((x1 - x2), 2) + pow((y1 - y2), 2));
		v[1] = sqrt(pow((x1 - x3), 2) + pow((y1 - y3), 2));
		v[2] = sqrt(pow((x2 - x3), 2) + pow((y2 - y3), 2));
		sort(v.begin(), v.end());
		if (pow(v[0], 2) + pow(v[1], 2) == pow(v[2], 2)) {
			printf("Yes\n");
		}
		else {
			printf("No\n");
		}
		printf("%.2f\n", v[0] + v[1] + v[2]);

		n--;
	}
}