#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <algorithm>
using namespace std;
struct P
{
double x,y;
};
int main()
{
int T,n;
int i,j;
P p1,p2,p3;
double X,Y,S,x,y,s;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
scanf("%lf %lf %lf %lf",&p1.x,&p1.y,&p2.x,&p2.y);
for(X = 0,Y = 0,S = 0,i = 3; i <= n; ++i)
{
scanf("%lf %lf",&p3.x,&p3.y);
x = (p1.x + p2.x + p3.x);
y = (p1.y + p2.y + p3.y);
s = ((p3.x - p1.x)*(p2.y - p1.y) - (p2.x - p1.x)*(p3.y - p1.y))/2;
X += x*s;
Y += y*s;
S += s;
p2 = p3;
}
printf("%.2lf %.2lf\n",X/S/3,Y/S/3);
}
return 0;
}