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;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 300000;
const int MAXHP = 2 * MAXN + 4;
typedef struct P {
  int x, y, id;
  P() {}
  P(int x, int y) : x(x), y(y) {}
} P;
P operator-(const P &a, const P &b) { return P(a.x - b.x, a.y - b.y); }
long long operator^(const P &a, const P &b) {
  return (long long)a.x * b.y - (long long)a.y * b.x;
}
bool operator<(const P &a, const P &b) {
  bool apos = a.y > 0 || a.y == 0 && a.x > 0;
  bool bpos = b.y > 0 || b.y == 0 && b.x > 0;
  if (apos != bpos) return apos;
  return (a ^ b) > 0;
}
typedef struct HP {
  long long a, b, c;
  int id;
  HP() {}
  HP(long long a, long long b, long long c) : a(a), b(b), c(c) {}
  HP(P u, P v)
      : a(v.y - u.y),
        b(u.x - v.x),
        c((long long)u.x * v.y - (long long)u.y * v.x),
        id(100 * u.id + v.id) {}
} HP;
typedef struct HPIntersection {
  HP hp[MAXHP];
  int nhp;
  HP res[MAXHP];
  int head, tail;
  pair<double, double> p[MAXHP];
  double area;
  HPIntersection() {}
  static int quadrant(const HP &f) {
    if (f.b == 0)
      return f.a > 0 ? 0 : 2;
    else
      return f.b > 0 ? 1 : 3;
  }
  static int cmpslope(const HP &f, const HP &g) {
    int qf = quadrant(f), qg = quadrant(g);
    if (qf != qg) return qf < qg ? -1 : +1;
    if (qf == 1) {
      long long x = f.a * g.b - f.b * g.a;
      if (x != 0) return x > 0 ? -1 : +1;
    }
    if (qf == 3) {
      long long x = f.a * g.b - f.b * g.a;
      if (x != 0) return x > 0 ? -1 : +1;
    }
    return 0;
  }
  struct cmp {
    bool operator()(const HP &f, const HP &g) {
      int c = cmpslope(f, g);
      if (c != 0) return c < 0;
      if (f.b == 0 && f.a > 0) {
        long long x = f.c * g.a - f.a * g.c;
        return x > 0;
      }
      if (f.b == 0 && f.a < 0) {
        long long x = f.c * g.a - f.a * g.c;
        return x < 0;
      }
      if (f.b > 0) {
        long long x = f.c * g.b - f.b * g.c;
        return x > 0;
      }
      if (f.b < 0) {
        long long x = f.c * g.b - f.b * g.c;
        return x < 0;
      }
      assert(false);
      return false;
    }
  };
  bool redundant(const HP &f, const HP &g) {
    if (cmpslope(f, g) != 0) return false;
    if (f.b == 0 && f.a > 0) {
      long long x = f.c * g.a - f.a * g.c;
      assert(x >= 0);
      return true;
    }
    if (f.b == 0 && f.a < 0) {
      long long x = f.c * g.a - f.a * g.c;
      assert(x <= 0);
      return true;
    }
    if (f.b > 0) {
      long long x = f.c * g.b - f.b * g.c;
      assert(x >= 0);
      return true;
    }
    if (f.b < 0) {
      long long x = f.c * g.b - f.b * g.c;
      assert(x <= 0);
      return true;
    }
    assert(false);
    return false;
  }
  bool impossible(const HP &f, const HP &g) {
    int qf = quadrant(f), qg = quadrant(g);
    if (qf == 0 || qg == 2) return qf == 0 && qg == 2 && f.a * g.c < f.c * g.a;
    if (qf == 2 || qg == 0) return qf == 2 && qg == 0 && f.a * g.c > f.c * g.a;
    if (f.a * g.b - f.b * g.a != 0) return false;
    if (qf == 1 || qg == 3) return qf == 1 && qg == 3 && f.b * g.c < f.c * g.b;
    if (qf == 3 || qg == 1) return qf == 3 && qg == 1 && f.b * g.c > f.c * g.b;
    assert(false);
    return false;
  }
  bool towards(const HP &f, const HP &g) {
    int qf = quadrant(f), qg = quadrant(g), c = cmpslope(f, g);
    if (qf == 0) return qg == 1;
    if (qf == 1)
      return qg == 1 && c < 0 || qg == 2 || qg == 3 && f.a * g.b > f.b * g.a;
    if (qf == 2) return qg == 3;
    if (qf == 3)
      return qg == 3 && c < 0 || qg == 0 || qg == 1 && f.a * g.b > f.b * g.a;
    assert(false);
    return false;
  }
  bool satisfies(const HP &f, const HP &g, const HP &h) {
    if (!towards(g, h)) return false;
    long long xnum = g.c * h.b - g.b * h.c;
    long long ynum = g.a * h.c - g.c * h.a;
    long long den = g.a * h.b - g.b * h.a;
    assert(den != 0);
    assert(den > 0);
    return 1.0 * f.a * xnum + 1.0 * f.b * ynum <= 1.0 * f.c * den;
  }
  pair<double, double> intersect(const HP &g, const HP &h) {
    long long xnum = g.c * h.b - g.b * h.c;
    long long ynum = g.a * h.c - g.c * h.a;
    long long den = g.a * h.b - g.b * h.a;
    assert(den != 0);
    assert(den > 0);
    return make_pair(1.0 * xnum / den, 1.0 * ynum / den);
  }
  bool redundant(const HP &f, const HP &g, const HP &h) {
    return impossible(g, h) || satisfies(f, g, h);
  }
  bool solve() {
    sort(hp, hp + nhp, cmp());
    head = tail = 0;
    for (int i = (0); i < (nhp); ++i) {
      while (head - tail >= 1 && redundant(res[head - 1], hp[i])) --head;
      while (head - tail >= 2 && redundant(res[head - 1], res[head - 2], hp[i]))
        --head;
      res[head++] = hp[i];
    }
    while (head - tail >= 3 &&
           redundant(res[head - 1], res[head - 2], res[tail]))
      --head;
    while (true) {
      if (head - tail >= 3 &&
          redundant(res[tail], res[head - 1], res[tail + 1])) {
        ++tail;
        continue;
      }
      if (head - tail >= 3 &&
          redundant(res[head - 1], res[head - 2], res[tail])) {
        --head;
        continue;
      }
      break;
    }
    if (head - tail == 2 && impossible(res[tail], res[tail + 1])) return false;
    if (head - tail == 3 && !satisfies(res[tail], res[tail + 1], res[tail + 2]))
      return false;
    for (int i = (tail); i < (head); ++i)
      if (!towards(res[i], res[i + 1 >= head ? tail : i + 1])) {
        printf("unbounded\n");
        exit(0);
      }
    for (int i = (tail); i < (head); ++i) {
      int j = i + 1 >= head ? tail : i + 1;
      p[i] = intersect(res[i], res[j]);
    }
    area = 0;
    for (int i = (tail); i < (head); ++i) {
      int j = i + 1 >= head ? tail : i + 1;
      area += p[i].first * p[j].second - p[i].second * p[j].first;
    }
    area /= 2;
    return true;
  }
} HPIntersection;
int n;
P p[MAXN];
P r[4];
HPIntersection inter;
void run(int casenr) {
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) scanf("%d%d", &p[i].x, &p[i].y);
  r[0] = P(-1000000, -1000000);
  r[1] = P(+1000000, -1000000);
  r[2] = P(+1000000, +1000000);
  r[3] = P(-1000000, +1000000);
  P O = p[0];
  for (int i = (1); i <= (n); ++i) p[i] = p[i] - p[0];
  for (int i = (0); i < (4); ++i) r[i] = r[i] - p[0];
  for (int i = (0); i < (n - 1); ++i) p[i] = p[i + 1];
  --n;
  for (int i = (0); i < (n); ++i) p[i].id = i;
  for (int i = (0); i < (4); ++i) r[i].id = n + i;
  sort(p, p + n);
  for (int i = (0); i < (n - 1); ++i)
    if (!(p[i] < p[i + 1])) {
      printf("0.0\n");
      return;
    }
  inter.nhp = 0;
  for (int i = (0); i < (n); ++i)
    inter.hp[inter.nhp++] = HP(p[i], p[(i + 1) % n]);
  for (int i = (0); i < (4); ++i)
    inter.hp[inter.nhp++] = HP(r[i], r[(i + 1) % 4]);
  for (int at = 0, to = 0; at < n; ++at) {
    if (at == to) to = (to + 1) % n;
    while (to != at && (p[at] ^ p[to]) > 0) to = (to + 1) % n;
    if (at == to) continue;
    if ((p[at] ^ p[to]) == 0) {
      printf("0.0\n");
      return;
    }
    inter.hp[inter.nhp++] = HP(p[to], p[at]);
  }
  for (int i = (0); i < (inter.nhp); ++i)
    if (inter.hp[i].c < 0)
      inter.hp[i].a *= -1, inter.hp[i].b *= -1, inter.hp[i].c *= -1;
  if (!inter.solve()) {
    printf("empty\n");
    return;
  }
  printf("%.9lf\n", inter.area);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) run(i);
  return 0;
}