Lifting the Stone

Time limit1sMemory limit128 MB

Problem

A heavy stone covers a secret opening in the floor. Lifting it triggers a mechanism that fires poisoned arrows, so the stone must be raised very slowly and kept perfectly level: no side may rise before another. To do this, a rope is tied exactly at the stone's centre of gravity and the stone is lifted with a pulley.

The stone has the shape of a polygon and the same height everywhere, so its centre of gravity is the centroid (area centre) of that polygon. Given the polygon, compute its centre of gravity.

Input

The first line contains an integer $T$, the number of test cases.

Each test case begins with a line containing an integer $N$ ($3 \le N \le 1000000$), the number of vertices of the polygon. Each of the next $N$ lines contains two integers $X_i$ and $Y_i$ ($|X_i|, |Y_i| \le 20000$), the coordinates of the $i$-th vertex. Connecting the vertices in the given order forms the polygon.

Edges never cross, and only neighbouring edges touch, at their shared vertex. The polygon's area is never zero (it never collapses to a line). Vertices may be given in either clockwise or counter-clockwise order.

Output

For each test case, print one line with two numbers separated by a single space: the coordinates $X$ and $Y$ of the centre of gravity.

Round each coordinate to exactly two digits after the decimal point. Rounding is half-up: a value exactly halfway is rounded away from zero (for example $0.005$ becomes $0.01$ and $-0.005$ becomes $-0.01$). If a coordinate rounds to zero, print it as 0.00, never -0.00.

The centre of gravity may lie outside the polygon when the polygon is not convex; print it in that case as well.