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 int N = 5e5 + 7;
const long double eps = 1e-7;
int t, n, q, k, s, op, x[N], y[N], xa[N], ya[N];
struct node {
  long double x, y;
} e[N], f[N];
struct vec {
  long double a, b, c, d;
} w[N], g[N], h[N];
struct vat {
  int x, y;
} gt[N];
inline int read() {
  int num = 0;
  char t = '+', g = getchar();
  while (g < 48 || 57 < g) t = g, g = getchar();
  while (47 < g && g < 58) num = num * 10 + g - 48, g = getchar();
  if (t == '-') return -num;
  return num;
}
inline bool cmp(node a, node b) { return atan2(a.y, a.x) < atan2(b.y, b.x); }
inline bool dmp(node a, node b) { return atan2(a.y, a.x) > atan2(b.y, b.x); }
inline bool tmp(vec a, vec b) {
  return atan2(a.d - a.b, a.c - a.a) < atan2(b.d - b.b, b.c - b.a);
}
inline bool qmp(vat a, vat b) {
  if (a.x == b.x) return a.y < b.y;
  return a.x < b.x;
}
inline long double getvac(node a, node b) { return a.x * b.y - a.y * b.x; }
inline void adds(node a, node b) {
  swap(a, b);
  q++, w[q].a = a.x + x[1], w[q].b = a.y + y[1], w[q].c = b.x + x[1],
       w[q].d = b.y + y[1];
}
inline bool eps_check(long double u) {
  if (-eps <= u && u <= eps) return 1;
  return 0;
}
inline bool node_check(vec u, long double x, long double y) {
  node a, b;
  a.x = u.c - u.a, a.y = u.d - u.b, b.x = x - u.a, b.y = y - u.b;
  return (getvac(a, b) >= -eps);
}
inline node getnode(vec a, vec b) {
  node z;
  long double f1 = (a.d - a.b) * (b.c - b.a), f2 = (b.d - b.b) * (a.c - a.a),
              f3 = (a.b - b.b) * (b.c - b.a) * (a.c - a.a);
  f3 = f3 - f1 * a.a + f2 * b.a;
  z.x = f3 / (f2 - f1);
  if (eps_check(a.a - a.c)) swap(a, b);
  z.y = (z.x - a.a) * (a.d - a.b) / (a.c - a.a) + a.b;
  return z;
}
inline bool check(vec a, vec b, vec c) {
  node z = getnode(b, c);
  return node_check(a, z.x, z.y);
}
inline bool getvat(node a, node b) {
  a.x -= b.x, a.y -= b.y, b.x = -b.x, b.y = -b.y;
  return (getvac(a, b) <= eps);
}
inline bool getvas(node a, node b) {
  a.x -= b.x, a.y -= b.y, b.x = -b.x, b.y = -b.y;
  return (getvac(a, b) <= -eps);
}
inline int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int main() {
  t = read();
  bool og = 0;
  while (t--) {
    n = read(), q = 0, k = 0, op = 0;
    bool fl = 0;
    for (int i = 1; i <= n; i++) xa[i] = x[i] = read(), ya[i] = y[i] = read();
    for (int i = 2; i <= n; i++)
      x[i] = x[i] - x[1], y[i] = y[i] - y[1], e[i - 1].x = x[i],
      e[i - 1].y = y[i];
    n--;
    for (int i = 2; i <= n + 1; i++) {
      int z = gcd(abs(x[i]), abs(y[i]));
      x[i] /= z, y[i] /= z;
      if (x[i] < 0) x[i] = -x[i], y[i] = -y[i];
      if (x[i] == 0) y[i] = 1;
      if (y[i] == 0) x[i] = 1;
      op++, gt[op].x = x[i], gt[op].y = y[i];
    }
    sort(gt + 1, gt + op + 1, qmp);
    for (int i = 2; i <= op; i++)
      if (gt[i - 1].x == gt[i].x && gt[i - 1].y == gt[i].y) fl = 1;
    sort(e + 1, e + n + 1, cmp);
    for (int i = 1; i <= n; i++) e[i + n] = e[i];
    int j = 1;
    for (int i = 1; i <= n; i++) {
      j = max(j, i + 1);
      while (j <= i + n - 2 && getvat(e[i], e[j + 1])) j++;
      if (getvat(e[i], e[j])) adds(e[i], e[j]);
      if (getvat(e[i], e[i + 1])) adds(e[i], e[i + 1]);
    }
    q++, w[q].a = -1000000, w[q].b = 1000000, w[q].c = 1000000,
         w[q].d = 1000000;
    q++, w[q].a = 1000000, w[q].b = 1000000, w[q].c = 1000000,
         w[q].d = -1000000;
    q++, w[q].a = 1000000, w[q].b = -1000000, w[q].c = -1000000,
         w[q].d = -1000000;
    q++, w[q].a = -1000000, w[q].b = -1000000, w[q].c = -1000000,
         w[q].d = 1000000;
    sort(w + 1, w + q + 1, tmp), g[1] = w[1], k = 1;
    for (int i = 2; i <= q; i++) {
      if (eps_check(atan2(w[i].d - w[i].b, w[i].c - w[i].a) -
                    atan2(g[k].d - g[k].b, g[k].c - g[k].a))) {
        if (node_check(w[i], g[k].a, g[k].b)) g[k] = w[i];
      } else
        g[++k] = w[i];
    }
    int l = 1, r = 2;
    for (int i = 1; i <= 2; i++) h[i] = g[i];
    for (int i = 3; i <= k; i++) {
      if (i == 3) {
        node a, b;
        a = getnode(h[1], h[2]);
        b = getnode(h[2], h[1]);
      }
      while (r - l >= 1 && check(g[i], h[r], h[r - 1])) r--;
      while (r - l >= 1 && check(g[i], h[l], h[l + 1])) l++;
      h[++r] = g[i];
    }
    while (r - l >= 2 && check(h[l], h[r], h[r - 1])) r--;
    if (r - l <= 1 || fl) {
      if (!og) printf("0\n");
    } else {
      s = 0;
      long double ans = 0;
      for (int i = l; i < r; i++) f[++s] = getnode(h[i], h[i + 1]);
      f[++s] = getnode(h[l], h[r]);
      for (int i = 2; i <= s; i++) f[i].y -= f[1].y, f[i].x -= f[1].x;
      for (int i = 2; i < s; i++) ans = ans + abs(getvac(f[i], f[i + 1])) / 2;
      printf("%.9Lf\n", ans);
    }
  }
}