模板
#include<stdio.h>
using namespace std;
struct point
{
double x, y;
}node[1000001];
point bcenter(point pnt[], int n)
{
point p, s;
double tp, area = 0, tpx = 0, tpy = 0;
p.x = pnt[0].x;
p.y = pnt[0].y;
for (int i = 1; i <= n; ++i)
{ // point:0 ~ n - 1
s.x = pnt[(i == n) ? 0 : i].x;
s.y = pnt[(i == n) ? 0 : i].y;
tp = (p.x * s.y - s.x * p.y);
area += tp / 2;
tpx += (p.x + s.x) * tp;
tpy += (p.y + s.y) * tp;
p.x = s.x;
p.y = s.y;
}
s.x = tpx / (6 * area);
s.y = tpy / (6 * area);
return s;
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%lf%lf",&node[i].x,&node[i].y);
}
point temp = bcenter(node,n);
printf("%.2lf %.2lf\n",temp.x,temp.y);
}
return 0;
}