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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) f = ch == '-' ? -1 : f, ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
const int N = 200005;
const int M = N * 3 << 1;
const long double EPS = 1e-7;
const long double INF = 1e+6;
inline bool equ(long double x, long double y) { return fabs(x - y) <= EPS; }
inline int sgn(long double x) { return equ(x, 0.) ? 0 : (x < 0 ? -1 : 1); }
struct P {
  long double x, y;
  inline P(long double x_ = 0., long double y_ = 0.) { x = x_, y = y_; }
  inline P operator+(P const p) const { return P(x + p.x, y + p.y); }
  inline P operator-(P const p) const { return P(x - p.x, y - p.y); }
  inline P operator*(long double const k) const { return P(x * k, y * k); }
  inline long double operator*(P const p) const { return x * p.x + y * p.y; }
  inline long double operator^(P const p) const { return x * p.y - y * p.x; }
  inline long double mod2() { return (*this) * (*this); }
  inline long double mod() { return sqrt(mod2()); }
  inline int quad() {
    if (sgn(x) > 0 && sgn(y) >= 0) return 0;
    if (sgn(y) > 0 && sgn(x) <= 0) return 1;
    if (sgn(x) < 0 && sgn(y) <= 0) return 2;
    return 3;
  }
} house[N];
inline bool operator<(P p, P q) {
  return p.quad() < q.quad() || p.quad() == q.quad() && sgn(p ^ q) > 0;
}
pair<P, int> srt[M];
struct L {
  P p, v;
  inline L() {}
  inline L(P p_, P v_) { p = p_, v = v_; }
} tmp[M];
int hpl[M];
inline bool cmp(L a, L b) { return a.v < b.v; }
inline bool in(P p, L l) { return sgn((p - l.p) ^ l.v) > 0; }
inline P ict(L a, L b) {
  return b.p + (b.v * (((a.p - b.p) ^ a.v) / (b.v ^ a.v)));
}
struct poly {
  P pts[M];
  int tot;
  inline long double area() {
    long double ret = 0.;
    for (int i = 0; i < tot; ++i) ret += pts[i + 1] ^ pts[i];
    return fabs(ret) * .5;
  }
} ch;
int T, n, cnt, head, tail;
inline long double HPI() {
  tmp[++cnt] = L(P(INF, INF), P(0, -1));
  tmp[++cnt] = L(P(INF, -INF), P(-1, 0));
  tmp[++cnt] = L(P(-INF, -INF), P(0, 1));
  tmp[++cnt] = L(P(-INF, INF), P(1, 0));
  sort(tmp + 1, tmp + 1 + cnt, cmp);
  int cnt_ = 0;
  for (int i = 1; i <= cnt; ++i)
    if (!cnt_ || sgn(tmp[i].v ^ tmp[cnt_].v))
      tmp[++cnt_] = tmp[i];
    else if (in(tmp[i].p, tmp[cnt_]))
      tmp[cnt_] = tmp[i];
  cnt = cnt_, head = 1, tail = 2;
  hpl[1] = 1, hpl[2] = 2;
  for (int i = 3; i <= cnt; ++i) {
    for (; head < tail && !in(ict(tmp[hpl[tail]], tmp[hpl[tail - 1]]), tmp[i]);
         --tail)
      ;
    for (; head < tail && !in(ict(tmp[hpl[head]], tmp[hpl[head + 1]]), tmp[i]);
         ++head)
      ;
    if (head == tail && sgn(tmp[i].v ^ tmp[hpl[head]].v) >= 0) return 0.;
    hpl[++tail] = i;
  }
  for (; head < tail &&
         !in(ict(tmp[hpl[tail]], tmp[hpl[tail - 1]]), tmp[hpl[head]]);
       --tail)
    ;
  for (; head < tail &&
         !in(ict(tmp[hpl[head]], tmp[hpl[head + 1]]), tmp[hpl[tail]]);
       ++head)
    ;
  ch.tot = tail - head + 1;
  for (int i = head; i < tail; ++i)
    ch.pts[i - head + 1] = ict(tmp[hpl[i]], tmp[hpl[i + 1]]);
  ch.pts[0] = ch.pts[tail - head + 1] = ict(tmp[hpl[tail]], tmp[hpl[head]]);
  return ch.area();
}
void add_half_plane(int x, int y) {
  if (x == y) return;
  P p = house[x], q = house[y];
  if (sgn((house[0] - q) ^ (p - q)) >= 0) tmp[++cnt] = L(q, p - q);
  if (sgn((house[0] - q) ^ (p - q)) <= 0) tmp[++cnt] = L(p, q - p);
}
void chose() {
  for (int i = 1; i < n; ++i)
    srt[(i << 1) - 1] = make_pair(house[i] - house[0], i),
                   srt[i << 1] = make_pair(house[0] - house[i], -i);
  sort(srt + 1, srt + (n - 1 << 1) + 1);
  for (int i = 1, cur = 1; i <= n - 1 << 1; ++i) {
    for (; i == cur || srt[cur].second < 0; cur = cur % (n - 1 << 1) + 1)
      ;
    add_half_plane(srt[i].second * sgn(srt[i].second), srt[cur].second);
  }
  reverse(srt + 1, srt + (n - 1 << 1) + 1);
  for (int i = 1, cur = 1; i <= n - 1 << 1; ++i) {
    for (; i == cur || srt[cur].second < 0; cur = cur % (n - 1 << 1) + 1)
      ;
    if (srt[i].second < 0) add_half_plane(-srt[i].second, srt[cur].second);
  }
}
int main() {
  for (T = read(); T--;) {
    n = read();
    for (int i = 0, x, y; i < n; ++i)
      x = read(), y = read(), house[i] = P(x, y);
    cnt = 0, chose(), printf("%.12lf\n", (double)HPI());
  }
  return 0;
}