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 sgn(long double x) {
  if (fabs(x) <= 1e-13) return 0;
  return x < 0 ? -1 : 1;
}
int Plane[2][2] = {{2, 1}, {3, 4}};
struct P {
  long double x, y, deg;
  int p;
  P() {}
  P(long double _x, long double _y) {
    x = _x;
    y = _y;
    p = Plane[y < 0][x > 0];
  }
  P operator+(const P &b) const { return P(x + b.x, y + b.y); }
  P operator-(const P &b) const { return P(x - b.x, y - b.y); }
  P operator*(const long double &b) const { return P(x * b, y * b); }
  long double operator*(const P &b) const { return x * b.y - y * b.x; }
  bool operator<(const P &a) const {
    if (p != a.p) return p < a.p;
    return sgn(*this * a) > 0;
  }
  bool operator==(const P &a) const { return !sgn(x - a.x) && !sgn(y - a.y); }
  bool jdb(const P &a) const {
    return !sgn(*this * a) && sgn(x) == sgn(a.x) && sgn(y) == sgn(a.y);
  }
};
struct Hp {
  P a, b;
  Hp() {}
  Hp(P x, P y) {
    a = x;
    b = y - x;
  }
  bool contain(P x) const { return sgn((x - a) * b) >= 0; }
};
P getsec(Hp a, Hp b) {
  long double s1 = (b.a - a.a) * a.b;
  long double s2 = a.b * (b.a + b.b - a.a);
  long double k = s1 / (s1 + s2);
  return b.a + b.b * k;
}
bool cmp(P a, P b) { return a.deg < b.deg; }
bool cmpL(Hp a, Hp b) {
  if (a.b.jdb(b.b)) return sgn(a.b * (b.a - a.a)) > 0;
  return a.b < b.b;
}
P p[400005];
Hp l[400005 * 2];
Hp q[400005 * 2];
P tmp[400005 * 2];
long double calcS(int cnt) {
  long double inf = 1e6, ans = 0;
  l[++cnt] = Hp(P(-inf, -inf), P(-inf, inf));
  l[++cnt] = Hp(P(-inf, inf), P(inf, inf));
  l[++cnt] = Hp(P(inf, inf), P(inf, -inf));
  l[++cnt] = Hp(P(inf, -inf), P(-inf, -inf));
  sort(l + 1, l + cnt + 1, cmpL);
  int Cnt = 1;
  for (int i = 2; i <= cnt; i++)
    if (!l[i].b.jdb(l[i - 1].b)) l[++Cnt] = l[i];
  if (Cnt < 2) return 0;
  cnt = Cnt;
  int h = 1, t = 0;
  q[++t] = l[1];
  q[++t] = l[2];
  for (int i = 3; i <= cnt; i++) {
    for (; h < t && !l[i].contain(getsec(q[t], q[t - 1])); t--)
      ;
    for (; h < t && !l[i].contain(getsec(q[h], q[h + 1])); h++)
      ;
    q[++t] = l[i];
  }
  for (; h < t && !q[h].contain(getsec(q[t], q[t - 1])); t--)
    ;
  for (; h < t && !q[t].contain(getsec(q[h], q[h + 1])); h++)
    ;
  if (t - h <= 1) return 0;
  Cnt = 0;
  for (int i = h; i < t; i++) tmp[++Cnt] = getsec(q[i], q[i + 1]);
  tmp[++Cnt] = getsec(q[t], q[h]);
  for (int i = 1; i < Cnt; i++) ans += tmp[i] * tmp[i + 1];
  ans += tmp[Cnt] * tmp[1];
  return ans / 2;
}
void solve() {
  int n, m, cnt = 0;
  scanf("%d", &n);
  m = 2 * n - 1;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    p[i].x = x;
    p[i].y = y;
    if (!i) continue;
    p[i].deg = atan2(p[i].y - p[0].y, p[i].x - p[0].x);
  }
  sort(p + 1, p + n, cmp);
  for (int i = 1; i < n; i++)
    p[i + n - 1] = p[i], p[i + n - 1].deg += 2 * acos(-1);
  for (int i = 1, j = 1; i < n; i++) {
    for (; j + 1 < m && sgn(p[i].deg + acos(-1) - p[j + 1].deg) >= 0; j++)
      ;
    if (!sgn(p[i + 1].deg - p[i].deg)) return puts("0"), void(0);
    if (i != j && !sgn(p[j].deg - p[i].deg - acos(-1)))
      return puts("0"), void(0);
    if (i != j) {
      l[++cnt] = Hp(P(p[i + 1].x, p[i + 1].y), P(p[i].x, p[i].y));
      l[++cnt] = Hp(P(p[j].x, p[j].y), P(p[i].x, p[i].y));
    }
  }
  printf("%.15lf\n", (double)calcS(cnt));
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) solve();
}