Problem: Bearland is a big square on the plane. It contains all points with coordinates not exceeding 106 by the absolute value.

There are n houses in Bearland. The i-th of them is located at the point (xi, yi). The n points are distinct, but some subsets of them may be collinear.

Bear Limak lives in the first house. He wants to destroy his house and build a new one somewhere in Bearland.

Bears don't like big changes. For every three points (houses) pi, pj and pk, the sign of their cross product (pj - pi) × (pk - pi) should be the same before and after the relocation. If it was negative/positive/zero, it should still be negative/positive/zero respectively. This condition should be satisfied for all triples of indices (i, j, k), possibly equal to each other or different than 1. Additionally, Limak isn't allowed to build the house at the point where some other house already exists (but it can be the point where his old house was).

In the formula above, we define the difference and the cross product of points (ax, ay) and (bx, by) as: 

(ax, ay) - (bx, by) = (ax - bx, ay - by),  (ax, ay) × (bx, by) = ax·by - ay·bx.

Consider a set of possible new placements of Limak's house. Your task is to find the area of that set of points.

Formally, let's say that Limak chooses the new placement randomly (each coordinate is chosen independently uniformly at random from the interval [ - 106, 106]). Let p denote the probability of getting the allowed placement of new house. Let S denote the area of Bearland (S = 4·1012). Your task is to find p·S.

Input

The first line of the input contains an integer T (1 ≤ T ≤ 500) — the number of test cases. The description of the test cases follows.

The first line of the description of a test case contains an integer n (3 ≤ n ≤ 200 000) — the number of houses.

The i-th of the next n lines contains two integers xi and yi ( - 106 ≤ xi, yi ≤ 106) — coordinates of the i-th house. No two houses are located at the same point in the same test case. Limak lives in the first house.

The sum of n won't exceed 200 000.

Output

Print one real value, denoting the area of the set of points that are possible new placements of Limak's house.

Your answer will be considered correct if its absolute or relative error doesn't exceed 10 - 6. More precisely, let the jury's answer be b, and your answer be a. Then your answer will be accepted if and only if <image>.

Example

Input

4
4
5 3
0 1
10 1
3 51
3
-999123 700000
-950000 123456
-950000 987654
3
2 3
10 -1
-4 6
5
1 3
5 2
6 1
4 4
-3 3


Output

250.000000000000
100000000000.000000000000
0.000000000000
6.562500000000

Note

In the sample test, there are 4 test cases.

In the first test case, there are four houses and Limak's one is in (5, 3). The set of valid new placements form a triangle with vertices in points (0, 1), (10, 1) and (3, 51), without its sides. The area of such a triangle is 250.

In the second test case, the set of valid new placements form a rectangle of width 50 000 and height 2 000 000. Don't forget that the new placement must be inside the big square that represents Bearland.

In the third test case, the three given points are collinear. Each cross product is equal to 0 and it should be 0 after the relocation as well. Hence, Limak's new house must lie on the line that goes through the given points. Since it must also be inside the big square, new possible placements are limited to some segment (excluding the two points where the other houses are). The area of any segment is 0.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-12, pi = acosl(-1);
const int maxn = 400005;
struct node {
  long double x, y;
  void init() {
    double a, b;
    scanf("%lf%lf", &a, &b);
    x = a, y = b;
  }
  node(void) {}
  node(long double a, long double b) : x(a), y(b) {}
};
node operator+(const node &a, const node &b) {
  return node(a.x + b.x, a.y + b.y);
}
node operator-(const node &a, const node &b) {
  return node(a.x - b.x, a.y - b.y);
}
node operator*(const node &a, const long double &b) {
  return node(a.x * b, a.y * b);
}
long double operator*(const node &a, const node &b) {
  return a.x * b.x + a.y * b.y;
}
long double operator^(const node &a, const node &b) {
  return a.x * b.y - a.y * b.x;
}
struct line {
  node p, v;
  long double ang;
  line(void) {}
  line(node a, node b) { p = a, v = b - a; }
};
node cross(const line &a, const line &b) {
  return b.p + b.v * ((a.v ^ (a.p - b.p)) / (a.v ^ b.v));
}
line L[maxn];
long double ang[maxn];
node p[maxn];
int n, cnt, ord[maxn];
bool cmp(int a, int b) { return ang[a] < ang[b]; }
bool cmp1(const line &a, const line &b) {
  if (fabsl(a.ang - b.ang) < eps) return ((a.p - b.p) ^ b.v) < -eps;
  return a.ang < b.ang;
}
bool cmp2(const line &a, const line &b, const line &c) {
  node p = cross(a, b);
  return ((p - c.p) ^ c.v) > eps;
}
node o;
void planar() {
  for (int i = 1; i <= cnt; i++) {
    if (((o - L[i].p) ^ L[i].v) == 0) {
      printf("0\n");
      return;
    }
    if (((o - L[i].p) ^ L[i].v) > 0)
      L[i].p = L[i].p + L[i].v, L[i].v = L[i].v * -1;
  }
  int s = 1e6;
  L[++cnt] = line(node(-s, s), node(-s, -s)),
  L[++cnt] = line(node(-s, -s), node(s, -s));
  L[++cnt] = line(node(s, -s), node(s, s)),
  L[++cnt] = line(node(s, s), node(-s, s));
  for (int i = 1; i <= cnt; i++) {
    L[i].ang = atan2l(L[i].v.y, L[i].v.x);
    if (fabsl(L[i].ang - pi) < eps) L[i].ang = -pi;
  }
  sort(L + 1, L + cnt + 1, cmp1);
  int co = 1;
  for (int i = 2; i <= cnt; i++)
    if (fabsl(L[i].v ^ L[co].v) > eps) L[++co] = L[i];
  cnt = co;
  static line stk[maxn];
  int top = 0, bot = 1;
  for (int i = 1; i <= cnt; i++) {
    for (; bot < top && cmp2(stk[top - 1], stk[top], L[i]); top--)
      ;
    for (; bot < top && cmp2(stk[bot], stk[bot + 1], L[i]); bot++)
      ;
    stk[++top] = L[i];
  }
  for (; bot < top && cmp2(stk[top - 1], stk[top], stk[bot]); top--)
    ;
  for (; bot < top && cmp2(stk[bot], stk[bot + 1], stk[top]); bot++)
    ;
  if (top - bot < 2)
    printf("0\n");
  else {
    long double area = 0;
    static node po[maxn];
    int co = 0;
    for (int i = bot; i <= top; i++)
      po[co++] = cross(stk[i], stk[i == top ? bot : i + 1]);
    for (int i = 0; i < co; i++) area += (po[i] ^ po[(i + 1) % co]);
    printf("%.10f\n", double((fabsl(area) / 2)));
  }
}
void work() {
  scanf("%d", &n);
  o.init();
  n--;
  for (int i = 0; i < n; i++) p[i].init(), ord[i] = i;
  for (int i = 0; i < n; i++) {
    ang[i] = atan2l(p[i].y - o.y, p[i].x - o.x);
    if (fabsl(ang[i] - pi) < eps) ang[i] = -pi;
  }
  sort(ord, ord + n, cmp);
  for (int i = 1; i < n; i++)
    if (fabsl(ang[ord[i]] - ang[ord[i - 1]]) < eps) {
      printf("0\n");
      return;
    }
  cnt = 0;
  for (int i = 0; i < n; i++) L[++cnt] = line(p[ord[i]], p[ord[(i + 1) % n]]);
  for (int i = 0, j = 1; i < n; i++) {
    for (; j != i && ((p[ord[j]] - p[ord[i]]) ^ (o - p[ord[i]])) > -eps;
         j = (j + 1) % n)
      ;
    if ((j + n - 1) % n != i)
      L[++cnt] = line(p[ord[i]], p[ord[(j + n - 1) % n]]);
  }
  planar();
}
int main() {
  int t;
  scanf("%d", &t);
  for (; t; t--) work();
  return 0;
}