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 = 200010;
double X, Y;
struct Point {
  double x, y, angle;
  Point(double x = 0, double y = 0) : x(x), y(y) {}
  void get_angle() { angle = atan2(y - Y, x - X); }
  bool operator<(const Point &A) const { return angle < A.angle; }
  Point operator-(const Point &A) const { return Point(x - A.x, y - A.y); }
  double operator|(const Point &A) const { return x * A.y - y * A.x; }
} a[Maxn << 1], po[Maxn];
int n, pl;
double _abs(double x) { return x < 0 ? -x : x; }
int zero(double x) { return _abs(x) < 1e-10 ? 1 : 0; }
struct Segment {
  Point s, e;
  double angle;
  void get_angle() { angle = atan2(e.y - s.y, e.x - s.x); }
  bool operator<(const Segment &A) const {
    if (!zero(angle - A.angle)) return angle < A.angle;
    return ((e - s) | (A.s - s)) < -1e-10;
  }
} seg[Maxn << 1], deq[Maxn << 1];
int tot, head, tail;
Point jd(Segment s1, Segment s2) {
  Point p1 = s1.s, p2 = s1.e, p3 = s2.s, p4 = s2.e;
  double a1 = p1.y - p2.y, b1 = p2.x - p1.x, c1 = p1.x * p2.y - p2.x * p1.y;
  double a2 = p3.y - p4.y, b2 = p4.x - p3.x, c2 = p3.x * p4.y - p4.x * p3.y;
  return Point((c1 * b2 - c2 * b1) / (b1 * a2 - b2 * a1),
               (c2 * a1 - c1 * a2) / (b1 * a2 - b2 * a1));
}
double get_area() {
  double ret = 0;
  for (int i = 2; i < pl; i++) ret += (po[i] - po[1]) | (po[i + 1] - po[1]);
  return ret / 2.0;
}
double HPI() {
  sort(seg + 1, seg + tot + 1);
  int tmp = 0, i;
  for (i = 1; i <= tot; i++) {
    if (!tmp || !zero(seg[i].angle - seg[tmp].angle)) seg[++tmp] = seg[i];
  }
  deq[1] = seg[1];
  deq[2] = seg[2];
  head = 1;
  tail = 2;
  for (i = 3; i <= tmp; i++) {
    while (head < tail && ((seg[i].e - seg[i].s) |
                           (jd(deq[tail], deq[tail - 1]) - seg[i].s)) < -1e-10)
      tail--;
    while (head < tail && ((seg[i].e - seg[i].s) |
                           (jd(deq[head], deq[head + 1]) - seg[i].s)) < -1e-10)
      head++;
    deq[++tail] = seg[i];
  }
  while (head < tail && ((deq[head].e - deq[head].s) |
                         (jd(deq[tail], deq[tail - 1]) - deq[head].s)) < -1e-10)
    tail--;
  while (head < tail && ((deq[tail].e - deq[tail].s) |
                         (jd(deq[head], deq[head + 1]) - deq[tail].s)) < -1e-10)
    head++;
  if (tail - head < 2) return 0.0;
  pl = 0;
  for (i = head; i < tail; i++) po[++pl] = jd(deq[i], deq[i + 1]);
  po[++pl] = jd(deq[head], deq[tail]);
  return get_area();
}
int main() {
  int i, j, k;
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (i = 1; i <= n; i++) scanf("%lf%lf", &a[i].x, &a[i].y);
    X = a[1].x;
    Y = a[1].y;
    for (i = 2; i <= n; i++) a[i].get_angle();
    sort(a + 2, a + n + 1);
    tot = 0;
    bool bk = false;
    for (i = 2; i <= n; i++) a[n + i - 1] = a[i];
    for (i = 2; i <= n; i++) {
      double p = (a[i + 1] - a[i]) | (a[1] - a[i]);
      if (zero(p)) {
        bk = true;
        break;
      }
      if (p > 1e-10) {
        seg[++tot].s = a[i];
        seg[tot].e = a[i + 1];
        seg[tot].get_angle();
      }
    }
    if (bk == true) {
      printf("%.10lf\n", 0);
      continue;
    }
    for (i = 3; i <= n; i++) {
      double p = (a[i] - a[2]) | (a[1] - a[2]);
      if (p < -1e-10) break;
    }
    j = i - 1;
    for (i = 2; i <= n; i++) {
      double p = (a[j + 1] - a[i]) | (a[1] - a[i]);
      while ((j < i) || (j < i + n - 2 && p > -1e-10)) {
        j++;
        p = (a[j + 1] - a[i]) | (a[1] - a[i]);
      }
      if (j - i > 0) {
        p = (a[j] - a[i]) | (a[1] - a[i]);
        if (zero(p)) {
          bk = true;
          break;
        }
        seg[++tot].s = a[i];
        seg[tot].e = a[j];
        seg[tot].get_angle();
      }
    }
    if (bk == true) {
      printf("%.10lf\n", 0);
      continue;
    }
    seg[++tot].s = Point(-1e6, -1e6);
    seg[tot].e = Point(1e6, -1e6);
    seg[tot].get_angle();
    seg[++tot].s = Point(1e6, -1e6);
    seg[tot].e = Point(1e6, 1e6);
    seg[tot].get_angle();
    seg[++tot].s = Point(1e6, 1e6);
    seg[tot].e = Point(-1e6, 1e6);
    seg[tot].get_angle();
    seg[++tot].s = Point(-1e6, 1e6);
    seg[tot].e = Point(-1e6, -1e6);
    seg[tot].get_angle();
    printf("%.10lf\n", HPI());
  }
  return 0;
}