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 MAXN = 210000;
struct point {
  long long x, y;
  point(long long x = 0, long long y = 0) : x(x), y(y) {}
  point operator+(point a) { return point(x + a.x, y + a.y); }
  point operator-(point a) { return point(x - a.x, y - a.y); }
  long long operator*(point a) { return x * a.y - y * a.x; }
};
bool cmp(point a, point b) {
  if (a.y >= 0 && b.y < 0) return 1;
  if (a.y < 0 && b.y >= 0) return 0;
  if (a.y == 0 && b.y == 0) {
    if (a.x >= 0 && b.x < 0)
      return 1;
    else
      return 0;
  }
  return a * b > 0;
}
struct hp {
  long long a, b, c;
  int n;
  hp(point x, point y) {
    a = x.y - y.y;
    b = y.x - x.x;
    c = a * x.x + b * x.y;
    n = 0;
  }
};
int n;
point p[MAXN];
vector<hp> vv;
point q[MAXN * 2];
bool cmp2(hp a, hp b) {
  point pa = point(a.a, a.b);
  point push_back = point(b.a, b.b);
  if (pa.y >= 0 && push_back.y < 0) return 1;
  if (pa.y < 0 && push_back.y >= 0) return 0;
  if (pa.y == 0 && push_back.y == 0) {
    if (pa.x >= 0 && push_back.x < 0) return 1;
    if (pa.x < 0 && push_back.x >= 0) return 0;
  }
  long long k = pa * push_back;
  if (k > 0) return 1;
  if (k < 0) return 0;
  return a.c < b.c;
}
struct pointr {
  long double x, y;
  pointr(long double x, long double y) : x(x), y(y) {}
  pointr operator+(pointr a) { return pointr(x + a.x, y + a.y); }
  pointr operator-(pointr a) { return pointr(x - a.x, y - a.y); }
  long double operator*(pointr a) { return x * a.y - y * a.x; }
};
pointr cross(hp a, hp b) {
  long double d = a.a * b.b - a.b * b.a;
  long double dx = a.c * b.b - a.b * b.c;
  long double dy = a.a * b.c - a.c * b.a;
  return pointr(dx / d, dy / d);
}
vector<pointr> pp;
int en[700000];
bool bad(hp a, hp b, hp c) {
  pointr xx = cross(b, c);
  return xx.x * a.a + xx.y * a.b <= a.c;
}
bool bd2(hp a, hp b) {
  if (a.a * b.b - a.b * b.a != 0) return 0;
  if (a.a * b.a + a.b * b.b <= 0) return 0;
  if (a.a != 0) {
    long double c1 = a.c / abs(a.a);
    long double c2 = b.c / abs(b.a);
    if (c1 <= c2) return 1;
  } else {
    long double c1 = a.c / abs(a.b);
    long double c2 = b.c / abs(b.b);
    if (c1 <= c2) return 1;
  }
  return 0;
}
long double calc() {
  sort(vv.begin(), vv.end(), cmp2);
  vector<hp> st;
  for (int i = 0; i < vv.size(); ++i) vv[i].n = i;
  for (int i = 0; i < vv.size(); ++i) {
    while (true) {
      if (st.empty()) break;
      if (bd2(st.back(), vv[i])) {
        st.pop_back();
        continue;
      }
      if (st.size() >= 2 && bad(st[st.size() - 2], st.back(), vv[i])) {
        st.pop_back();
        continue;
      }
      break;
    }
    st.push_back(vv[i]);
  }
  for (int i = 0; i < vv.size(); ++i) {
    while (true) {
      if (st.empty()) break;
      if (bd2(st.back(), vv[i])) {
        st.pop_back();
        continue;
      }
      if (st.size() >= 2 && bad(st[st.size() - 2], st.back(), vv[i])) {
        st.pop_back();
        continue;
      }
      break;
    }
    st.push_back(vv[i]);
  }
  for (int i = 0; i < vv.size(); ++i) en[i] = -1;
  vv.clear();
  for (int i = 0; i < st.size(); ++i) {
    if (en[st[i].n] != -1) {
      for (int j = en[st[i].n]; j <= i; ++j) vv.push_back(st[j]);
      break;
    }
    en[st[i].n] = i;
  }
  pp.clear();
  for (int i = 0; i < vv.size() - 1; ++i) pp.push_back(cross(vv[i], vv[i + 1]));
  pp.push_back(pp[0]);
  long double sum = 0;
  for (int i = 0; i < pp.size() - 1; ++i) sum += pp[i] * pp[i + 1];
  sum /= 2;
  return abs(sum);
}
const int BR = 1000000;
void solve() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%lld%lld", &p[i].x, &p[i].y);
  for (int i = 1; i < n; ++i) q[i - 1] = p[i] - p[0];
  sort(q, q + n - 1, cmp);
  for (int i = 0; i < n - 1; ++i) q[i + n - 1] = q[i];
  vv.clear();
  for (int i = 0; i < n - 1; ++i) {
    if (q[i] * q[i + 1] == 0) {
      printf("0\n");
      return;
    }
  }
  int now = 0;
  for (int i = 0; i < n - 1; ++i) {
    now = max(now, i + 1);
    while (now < i + n - 1 && q[i] * q[now] > 0) ++now;
    if (now != i + n - 1 && q[i] * q[now] == 0) {
      printf("0\n");
      return;
    }
  }
  for (int i = 0; i < n - 1; ++i) {
    hp x = hp(q[i] + p[0], q[i + 1] + p[0]);
    if (x.a * p[0].x + x.b * p[0].y < x.c) {
      x.a = -x.a;
      x.b = -x.b;
      x.c = -x.c;
    }
    vv.push_back(x);
  }
  now = 0;
  for (int i = 0; i < n - 1; ++i) {
    while (now + 1 < i + n - 1 && q[i] * q[now + 1] >= 0) ++now;
    if (now != i) vv.push_back(hp(q[i] + p[0], q[now] + p[0]));
  }
  reverse(q, q + n - 1 + n - 1);
  now = 0;
  for (int i = 0; i < n - 1; ++i) {
    while (now + 1 < i + n - 1 && q[i] * q[now + 1] <= 0) ++now;
    if (now != i) vv.push_back(hp(q[now] + p[0], q[i] + p[0]));
  }
  vv.push_back(hp(point(-BR, -BR), point(BR, -BR)));
  vv.push_back(hp(point(BR, -BR), point(BR, BR)));
  vv.push_back(hp(point(BR, BR), point(-BR, BR)));
  vv.push_back(hp(point(-BR, BR), point(-BR, -BR)));
  printf("%.9Lf\n", calc());
}
int main() {
  int tt;
  scanf("%d", &tt);
  for (int i = 0; i < tt; ++i) {
    solve();
  }
  return 0;
}