#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;
}
