#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int get() { int r; cin >> r; return r; }
double dis(double p, double q, double r, double s) { return sqrt((p - r) * (p - r) + (q - s) * (q - s)); }
signed main() {
	int n; cin >> n;
	while (n--) {
		double x1, y1, x2, y2, x3, y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		double p = ((x3 - x2) * (x3 - x1) + (y3 - y2) * (y3 - y1)) / ((x3 - x2) * (y2 - y1) + (y3 - y2) * (x1 - x2)) / 2;
		double x4 = (x1 + x2) / 2 + p * (y2 - y1);
		double y4 = (y1 + y2) / 2 + p * (x1 - x2);
		double r = dis(x1, y1, x4, y4);
		printf("%.3f %.3f %.3f\n", x4, y4, r);
	}
}
