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;
int get() {
  char ch;
  while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-')
    ;
  if (ch == '-') {
    int s = 0;
    while (ch = getchar(), ch >= '0' && ch <= '9') s = s * 10 + ch - '0';
    return -s;
  }
  int s = ch - '0';
  while (ch = getchar(), ch >= '0' && ch <= '9') s = s * 10 + ch - '0';
  return s;
}
const int N = 200005;
const double eps = 1e-7;
const double MAX = 1000000;
int n;
struct point {
  double x, y;
  point(const double x_ = 0, const double y_ = 0) {
    x = x_;
    y = y_;
  }
  void read() {
    x = get();
    y = get();
  }
} a[N], origin, O;
point operator-(point a, point b) { return point(a.x - b.x, a.y - b.y); }
point operator+(point a, point b) { return point(a.x + b.x, a.y + b.y); }
double fabs(double x) { return x < 0 ? -x : x; }
double fmax(double x, double y) { return x > y ? x : y; }
double fmin(double x, double y) { return x < y ? x : y; }
bool isright(point a) { return a.x == 0 ? a.y > 0 : a.x > 0; }
double cross(point a, point b, point c) {
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
bool cmp(point a, point b) {
  if (isright(a) != isright(b)) return isright(a) > isright(b);
  return cross(origin, a, b) < 0;
}
struct halfplane {
  point s, vec;
  halfplane(point a = point(0, 0), point b = point(0, 0)) {
    s = a;
    vec = b;
  }
} hp[N * 2], hull[N * 2];
point h1[N * 2], h2[N * 2];
int m1, m2;
int m, k;
struct newpoint {
  double x, y;
  int id;
  newpoint(const double x_ = 0, const double y_ = 0, const int id_ = 0) {
    x = x_;
    y = y_;
    id = id_;
  }
} L1[N * 2], L2[N * 2];
int k1, k2;
double cross(newpoint a, newpoint b, newpoint c) {
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
void add(point a, point b) { hp[++m] = halfplane(a, b); }
bool cmp1(newpoint a, newpoint b) {
  return fabs(a.x - b.x) > eps ? a.x < b.x : a.y > b.y;
}
bool cmp2(newpoint a, newpoint b) {
  return fabs(a.x - b.x) > eps ? a.x < b.x : a.y < b.y;
}
double ans;
point getsec(double k1, double b1, double k2, double b2) {
  double x = (b2 - b1) / (k1 - k2);
  double y = k1 * x + b1;
  return point(x, y);
}
point getsec(point s1, point t1, point s2, point t2) {
  double k1 = (t1.y - s1.y) / (t1.x - s1.x), k2 = (t2.y - s2.y) / (t2.x - s2.x);
  double b1 = s1.y - s1.x * k1, b2 = s2.y - s2.x * k2;
  if (fabs(k1 - k2) < eps) {
    if (s1.x > s2.x) return s1;
    return s2;
  }
  return getsec(k1, b1, k2, b2);
}
void gethull() {
  k = 0;
  double lef = -MAX - O.x, rig = MAX - O.x;
  double L = -1e9, R = 1e9;
  for (int i = 1; i <= m; i++)
    if (fabs(hp[i].vec.x) < eps) {
      if (hp[i].vec.y > eps)
        lef = fmax(lef, hp[i].s.x);
      else
        rig = fmin(rig, hp[i].s.x);
    }
  k1 = k2 = 0;
  for (int i = 1; i <= m; i++)
    if (hp[i].vec.x > eps) {
      double k = hp[i].vec.y / hp[i].vec.x;
      double b = hp[i].s.y - k * hp[i].s.x;
      L1[++k1] = newpoint(k, -b, i);
    }
  sort(L1 + 1, L1 + 1 + k1, cmp1);
  int tp = 1;
  for (int i = 2; i <= k1; i++) {
    if (fabs(L1[i].x - L1[i - 1].x) < eps) continue;
    newpoint u = L1[i];
    while (tp > 1 && cross(L1[tp - 1], u, L1[tp]) < eps) tp--;
    L1[++tp] = u;
  }
  k1 = tp;
  for (int i = 1; i <= m; i++)
    if (hp[i].vec.x < -eps) {
      double k = hp[i].vec.y / hp[i].vec.x;
      double b = hp[i].s.y - k * hp[i].s.x;
      L2[++k2] = newpoint(k, -b, i);
    }
  sort(L2 + 1, L2 + 1 + k2, cmp2);
  tp = 1;
  for (int i = 2; i <= k2; i++) {
    if (fabs(L2[i].x - L2[i - 1].x) < eps) continue;
    newpoint u = L2[i];
    while (tp > 1 && cross(L2[tp - 1], L2[tp], u) < eps) tp--;
    L2[++tp] = u;
  }
  k2 = tp;
  ans = 0;
  m1 = m2 = 0;
  bool bz = 0;
  for (int i = k1; i >= 1; i--) {
    int x = L1[i].id;
    point u;
    if (i == k1) {
      double k = L1[i].x, b = -L1[i].y;
      u.y = k * L + b;
      u.x = L;
    } else {
      double k1 = L1[i].x, b1 = -L1[i].y, k2 = L1[i + 1].x, b2 = -L1[i + 1].y;
      u = getsec(k1, b1, k2, b2);
    }
    h1[++m1] = u;
    if (bz) break;
  }
  if (!bz) {
    ++m1;
    double k = L1[1].x, b = -L1[1].y;
    h1[m1].y = k * R + b;
    h1[m1].x = R;
  }
  bz = 0;
  for (int i = 1; i <= k2; i++) {
    int x = L2[i].id;
    point u;
    if (i == 1) {
      double k = L2[i].x, b = -L2[i].y;
      u.y = k * L + b;
      u.x = L;
    } else {
      double k1 = L2[i].x, b1 = -L2[i].y, k2 = L2[i - 1].x, b2 = -L2[i - 1].y;
      u = getsec(k1, b1, k2, b2);
    }
    h2[++m2] = u;
    if (bz) break;
  }
  if (!bz) {
    ++m2;
    double k = L2[k2].x, b = -L2[k2].y;
    h2[m2].y = k * R + b;
    h2[m2].x = R;
  }
  int m_ = 1;
  for (int i = 2; i <= m1; i++)
    if (!(fabs(h1[i].x - h1[i - 1].x) < 1e-6 &&
          fabs(h1[i].y - h1[i - 1].y) < 1e-6))
      h1[++m_] = h1[i];
  m1 = m_;
  m_ = 1;
  for (int i = 2; i <= m2; i++)
    if (!(fabs(h2[i].x - h2[i - 1].x) < 1e-6 &&
          fabs(h2[i].y - h2[i - 1].y) < 1e-6))
      h2[++m_] = h2[i];
  m2 = m_;
  int he1 = 1, he2 = 1;
  if (h2[1].y > h1[1].y) {
    while (getsec(h1[he1], h1[he1 + 1], h2[he2], h2[he2 + 1]).x >=
           fmin(h1[he1 + 1].x, h2[he2 + 1].x) - eps) {
      if (h1[he1 + 1].x < h2[he2 + 1].x)
        he1++;
      else
        he2++;
    }
    point u = getsec(h1[he1], h1[he1 + 1], h2[he2], h2[he2 + 1]);
    h1[he1] = h2[he2] = u;
  }
  int ta1 = m1, ta2 = m2;
  if (h2[m2].y > h1[m1].y) {
    while (getsec(h1[ta1 - 1], h1[ta1], h2[ta2 - 1], h2[ta2]).x <=
           fmax(h1[ta1 - 1].x, h2[ta2 - 1].x) + eps) {
      if (h1[ta1 - 1].x > h2[ta2 - 1].x)
        ta1--;
      else
        ta2--;
    }
    point u = getsec(h1[ta1 - 1], h1[ta1], h2[ta2 - 1], h2[ta2]);
    h1[ta1] = h2[ta2] = u;
  }
  if (h1[he1].x < lef - eps) {
    for (int i = he1; i <= ta1; i++)
      if (h1[i + 1].x > lef) {
        double k = (h1[i + 1].y - h1[i].y) / (h1[i + 1].x - h1[i].x);
        h1[i].y = h1[i].y + k * (lef - h1[i].x);
        h1[i].x = lef;
        he1 = i;
        break;
      }
    for (int i = he2; i <= ta2; i++)
      if (h2[i + 1].x > lef) {
        double k = (h2[i + 1].y - h2[i].y) / (h2[i + 1].x - h2[i].x);
        h2[i].y = h2[i].y + k * (lef - h2[i].x);
        h2[i].x = lef;
        he2 = i;
        break;
      }
  }
  if (h1[ta1].x > rig + eps) {
    for (int i = ta1; i >= he1; i--)
      if (h1[i - 1].x < rig) {
        double k = (h1[i].y - h1[i - 1].y) / (h1[i].x - h1[i - 1].x);
        h1[i].y = h1[i].y + k * (rig - h1[i].x);
        h1[i].x = rig;
        ta1 = i;
        break;
      }
    for (int i = ta2; i >= he2; i--)
      if (h2[i - 1].x < rig) {
        double k = (h2[i].y - h2[i - 1].y) / (h2[i].x - h2[i - 1].x);
        h2[i].y = h2[i].y + k * (rig - h2[i].x);
        h2[i].x = rig;
        ta2 = i;
        break;
      }
  }
  for (int i = he1; i <= ta1 - 1; i++)
    ans = ans + cross(origin, h1[i], h1[i + 1]);
  for (int i = he2; i <= ta2 - 1; i++)
    ans = ans + cross(origin, h2[i + 1], h2[i]);
  ans = ans + cross(origin, h2[he2], h1[he1]);
  ans = ans + cross(origin, h1[ta1], h2[ta2]);
  ans /= 2;
}
double solve() {
  n = get();
  n--;
  origin.read();
  O = origin;
  for (int i = 1; i <= n; i++) {
    a[i].read();
    a[i] = a[i] - origin;
  }
  origin = point(0, 0);
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; i++)
    if (fabs(cross(origin, a[i], a[i % n + 1])) < eps) return 0;
  m = 0;
  for (int i = 1; i <= n; i++)
    if (cross(origin, a[i], a[i % n + 1]) < -eps)
      add(a[i], a[i % n + 1] - a[i]);
    else
      add(a[i % n + 1], a[i] - a[i % n + 1]);
  int w = 1;
  for (int i = 1; i <= n; i++) {
    w = max(w, i + 1);
    while (cross(origin, a[i], a[(w - 1) % n + 1]) < -eps) w++;
    if ((w - 1) % n + 1 != i) {
      if (cross(origin, a[i], a[(w - 1) % n + 1]) < -eps)
        add(a[i], a[(w - 1) % n + 1] - a[i]);
      else
        add(a[(w - 1) % n + 1], a[i] - a[(w - 1) % n + 1]);
      if (fabs(cross(origin, a[i], a[(w - 1) % n + 1])) < eps) return 0;
    }
  }
  add(point(MAX, MAX) - O, point(0, -MAX * 2));
  add(point(MAX, -MAX) - O, point(-MAX * 2, 0));
  add(point(-MAX, -MAX) - O, point(0, MAX * 2));
  add(point(-MAX, MAX) - O, point(MAX * 2, 0));
  gethull();
  ans = fabs(ans);
  return ans;
}
int main() {
  for (int T = get(); T; T--) printf("%.9lf\n", solve());
  return 0;
}