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;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int maxn = 400100;
const double eps = 1e-8;
inline int dcmp(const double &first) { return first < -eps ? -1 : first > eps; }
struct point {
  double first, second;
  point() {}
  point(const double &_x, const double &_y) : first(_x), second(_y) {}
  friend point operator+(const point &first, const point &second) {
    return point(first.first + second.first, first.second + second.second);
  }
  friend point &operator+=(point &first, const point &second) {
    first.first += second.first, first.second += second.second;
    return first;
  }
  friend point operator-(const point &first, const point &second) {
    return point(first.first - second.first, first.second - second.second);
  }
  friend point &operator-=(point &first, const point &second) {
    first.first -= second.first, first.second -= second.second;
    return first;
  }
  friend point operator*(const point &first, const double &second) {
    return point(first.first * second, first.second * second);
  }
  friend point operator/(const point &first, const double &second) {
    return point(first.first / second, first.second / second);
  }
  friend bool operator<(const point &first, const point &second) {
    if (!dcmp(first.first - second.first))
      return dcmp(first.second - second.second) < 0;
    return first.first < second.first;
  }
  friend double operator*(const point &first, const point &second) {
    return first.first * second.first + first.second * second.second;
  }
  friend double operator^(const point &first, const point &second) {
    return first.first * second.second - first.second * second.first;
  }
} O(0, 0);
inline bool line_line(const point &P, const point &v, const point &Q,
                      const point &w, double &first) {
  point u = P - Q;
  if (!dcmp(v ^ w)) return 0;
  first = (w ^ u) / (v ^ w);
  return 1;
}
struct line {
  point p, v;
  line() {}
  line(const point &_p, const point &_v) : p(_p), v(_v) {}
};
inline point get_intersection(const line &first, const line &second) {
  double ret = 0;
  assert(line_line(first.p, first.v, second.p, second.v, ret));
  return first.p + first.v * ret;
}
inline bool on_left(const line &l, const point &p) {
  return (l.v ^ (p - l.p)) > 0;
}
inline bool half_plane(line *plane, const int &n_plane, point *poly,
                       int &n_poly) {
  static int pos[maxn + 5];
  static double ang[maxn + 5];
  for (int i = (0), i_end_ = (n_plane); i < i_end_; ++i)
    ang[i] = atan2(plane[i].v.second, plane[i].v.first), pos[i] = i;
  sort(pos, pos + n_plane,
       [&](int first, int second) { return ang[first] < ang[second]; });
  int head, rear;
  static point p[maxn + 5];
  static line q[maxn + 5];
  head = rear = 0;
  q[rear++] = plane[pos[0]];
  for (int i = (1), i_end_ = (n_plane); i < i_end_; ++i) {
    while (head < rear - 1 && !on_left(plane[pos[i]], p[rear - 2])) --rear;
    while (head < rear - 1 && !on_left(plane[pos[i]], p[head])) ++head;
    q[rear++] = plane[pos[i]];
    if (abs(q[rear - 1].v ^ q[rear - 2].v) < eps) {
      --rear;
      if (on_left(q[rear - 1], plane[pos[i]].p)) q[rear - 1] = plane[pos[i]];
    }
    if (head + 1 < rear)
      p[rear - 2] = get_intersection(q[rear - 2], q[rear - 1]);
  }
  while (head < rear - 1 && !on_left(q[head], p[rear - 2])) --rear;
  if (abs(q[head].v ^ q[rear - 1].v) < eps) {
    if (on_left(q[rear - 1], q[head].p))
      --rear;
    else
      ++head;
  }
  if (head + 1 >= rear) return 0;
  p[rear - 1] = get_intersection(q[rear - 1], q[head]);
  n_poly = 0;
  for (int i = (head), i_end_ = (rear); i < i_end_; ++i) poly[n_poly++] = p[i];
  return 1;
}
int n;
line plane[maxn + 5];
int n_plane = 0;
point a[maxn + 5];
bool bel[maxn + 5];
int pos[maxn + 5];
inline bool cmp(int first, int second) {
  return bel[first] == bel[second] ? (a[first] ^ a[second]) > 0
                                   : bel[first] < bel[second];
};
inline bool find_colinear() {
  for (int i = (0), i_end_ = (n); i < i_end_; ++i)
    if (abs(a[pos[i]] ^ a[pos[(i + 1) % n]]) < eps) return 1;
  return 0;
}
inline void add_restrict(const point &u, const point &v) {
  if (on_left(line(u, v - u), O))
    plane[n_plane++] = line(u, v - u);
  else
    plane[n_plane++] = line(v, u - v);
}
int main(void) {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = (0), i_end_ = (n); i < i_end_; ++i)
      scanf("%lf%lf", &a[(i + n - 1) % n].first, &a[(i + n - 1) % n].second);
    --n;
    for (int i = (0), i_end_ = (n); i < i_end_; ++i) a[i] -= a[n];
    for (int i = (0), i_end_ = (n); i < i_end_; ++i) {
      if (a[i].second)
        bel[i] = a[i].second > 0;
      else
        bel[i] = a[i].first > 0;
    }
    for (int i = (0), i_end_ = (n); i < i_end_; ++i) pos[i] = i;
    sort(pos, pos + n, cmp);
    if (find_colinear())
      printf("0\n");
    else {
      n_plane = 0;
      int j = 0;
      for (int i = (0), i_end_ = (n); i < i_end_; ++i) {
        add_restrict(a[pos[i]], a[pos[(i + 1) % n]]);
        while (j <= i || (j < i + n && (a[pos[i]] ^ a[pos[j % n]]) > 0)) ++j;
        if (j < i + n) add_restrict(a[pos[i]], a[pos[j % n]]);
      }
      static point res[maxn + 5];
      int res_n = 0;
      plane[n_plane++] = line(point(-1e6, -1e6) - a[n], point(2e6, 0));
      plane[n_plane++] = line(point(1e6, -1e6) - a[n], point(0, 2e6));
      plane[n_plane++] = line(point(1e6, 1e6) - a[n], point(-2e6, 0));
      plane[n_plane++] = line(point(-1e6, 1e6) - a[n], point(0, -2e6));
      half_plane(plane, n_plane, res, res_n);
      double ans = 0;
      for (int i = (0), i_end_ = (res_n); i < i_end_; ++i)
        ans += res[i] ^ res[(i + 1) % res_n];
      ans /= 2;
      printf("%.15f\n", ans);
    }
  }
  return 0;
}