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;
double eps = 1E-10;
struct PNT {
  double x, y;
};
struct LN {
  PNT a, b;
  double angle;
};
inline int dblcmp(double k) {
  if (abs(k) < eps)
    return 0;
  else
    return k > 0 ? 1 : -1;
}
inline double cross(const PNT& p0, const PNT& p1, const PNT& p2) {
  return (p1.x - p0.x) * (p2.y - p0.y) - (p1.y - p0.y) * (p2.x - p0.x);
}
double PNT_area(PNT* pts, int ptn) {
  if (ptn < 3) return 0;
  double ans = 0;
  for (int i = 1; i < ptn - 1; i++) ans += cross(pts[0], pts[i], pts[i + 1]);
  if (ans < 0) ans = -ans;
  return ans / 2;
}
inline void LN_create(LN& l, double x1, double y1, double x2, double y2) {
  l.a.x = x1;
  l.a.y = y1;
  l.b.x = x2;
  l.b.y = y2;
  l.angle = atan2(y2 - y1, x2 - x1);
}
inline void LN_eq(const LN& l, double& a, double& b, double& c) {
  a = l.b.y - l.a.y;
  b = l.a.x - l.b.x;
  c = l.a.y * (l.b.x - l.a.x) - l.a.x * (l.b.y - l.a.y);
}
void LN_intersect(const LN& l1, const LN& l2, PNT& p) {
  double a1, b1, c1, a2, b2, c2, det;
  LN_eq(l1, a1, b1, c1);
  LN_eq(l2, a2, b2, c2);
  det = a1 * b2 - a2 * b1;
  p.x = (c2 * b1 - c1 * b2) / det;
  p.y = (a2 * c1 - a1 * c2) / det;
}
bool LN_outside(const LN& l0, const LN& l1, const LN& l2) {
  PNT p;
  LN_intersect(l1, l2, p);
  return dblcmp(cross(l0.a, l0.b, p)) < 0;
}
bool cmp(const LN& l1, const LN& l2) {
  int d = dblcmp(l1.angle - l2.angle);
  return d == 0 ? dblcmp(cross(l2.a, l2.b, l1.a)) > 0 : d < 0;
}
void halfrun(LN* ll, int n, PNT* pts, int& ptn) {
  int i, j, *dq, a, b;
  sort(ll, ll + n, cmp);
  for (i = 0, j = 0; i < n; i++)
    if (dblcmp(ll[i].angle - ll[j].angle) > 0) ll[++j] = ll[i];
  n = j + 1;
  dq = (int*)malloc((n + 1) * sizeof(int));
  dq[0] = 0;
  dq[1] = 1;
  a = 0;
  b = 1;
  for (i = 2; i < n; i++) {
    while (b > a && LN_outside(ll[i], ll[dq[b]], ll[dq[b - 1]])) b--;
    while (b > a && LN_outside(ll[i], ll[dq[a]], ll[dq[a + 1]])) a++;
    dq[++b] = i;
  }
  while (b > a && LN_outside(ll[dq[a]], ll[dq[b]], ll[dq[b - 1]])) b--;
  while (b > a && LN_outside(ll[dq[b]], ll[dq[a]], ll[dq[a + 1]])) a++;
  dq[++b] = dq[a];
  for (j = 0, i = a; i < b; i++, j++)
    LN_intersect(ll[dq[i + 1]], ll[dq[i]], pts[j]);
  ptn = j;
  free(dq);
}
int main() {
  int t, ptn, n;
  double x0, y0, x, y;
  LN *ll, *lg;
  PNT* pts;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(12);
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> n;
    n--;
    cin >> x0 >> y0;
    ll = (LN*)malloc((n + 1) * sizeof(LN));
    for (int j = 0; j < n; j++) {
      cin >> x >> y;
      LN_create(ll[j], x0, y0, x, y);
    }
    sort(ll, ll + n, cmp);
    ll[n] = ll[0];
    lg = (LN*)malloc((2 * n + 4) * sizeof(LN));
    pts = (PNT*)malloc((2 * n + 4) * sizeof(PNT));
    int p = 0, q = 1;
    PNT r;
    r.x = x0;
    r.y = y0;
    int k = 0;
    int j;
    bool empty = false;
    for (j = 1; j <= n; j++) {
      int cx = dblcmp(cross(ll[j - 1].b, ll[j].b, r));
      if (cx > 0)
        LN_create(lg[k++], ll[j - 1].b.x, ll[j - 1].b.y, ll[j].b.x, ll[j].b.y);
      else if (cx < 0)
        LN_create(lg[k++], ll[j].b.x, ll[j].b.y, ll[j - 1].b.x, ll[j - 1].b.y);
      else {
        empty = true;
        break;
      }
    }
    j = 2;
    while (p != n && n > 2 && !empty) {
      j = (q + 1) % n;
      int cd = dblcmp(cross(ll[p].b, ll[q].b, r));
      int cx = cd * dblcmp(cross(ll[p].b, ll[j].b, r));
      if (cx == 0) {
        empty = true;
        break;
      } else if (cx < 0) {
        if (cd > 0)
          LN_create(lg[k++], ll[p].b.x, ll[p].b.y, ll[q].b.x, ll[q].b.y);
        p++;
        q--;
      }
      q = (q + 1) % n;
      if (p == q) q = (q + 1) % n;
      if ((q + 1) % n == p) p++;
    }
    if (empty)
      cout << 0.0 << endl;
    else {
      LN_create(lg[k++], -1E6, -1E6, 1E6, -1E6);
      LN_create(lg[k++], 1E6, -1E6, 1E6, 1E6);
      LN_create(lg[k++], 1E6, 1E6, -1E6, 1E6);
      LN_create(lg[k++], -1E6, 1E6, -1E6, -1E6);
      halfrun(lg, k, pts, ptn);
      cout << PNT_area(pts, ptn) << endl;
    }
    free(ll);
    free(lg);
    free(pts);
  }
  return 0;
}