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;
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
struct P {
  long long x, y;
  void read() { scanf("%lld%lld", &x, &y); }
  P operator-(const P& b) const { return P{x - b.x, y - b.y}; }
  void operator+=(const P& b) { x += b.x, y += b.y; }
  long long operator*(const P& b) const { return x * b.y - y * b.x; }
  long long cross(const P& b, const P& c) const {
    return (b - *this) * (c - *this);
  }
  bool isRight() const { return x > 0 || (x == 0 && y > 0); }
  bool operator<(const P& b) const {
    if (isRight() != b.isRight()) return isRight();
    return *this * b < 0;
  }
};
debug& operator<<(debug& dd, P p) {
  dd << make_pair(p.x, p.y);
  return dd;
}
struct L2 {
  P one, two;
  P dir() const { return two - one; }
  bool operator<(const L2& b) const { return dir() < b.dir(); }
  long double get_coeff(const L2& b) const {
    long double r = (b.dir() * (one - b.one)) / (long double)(dir() * b.dir());
    return r;
  }
  bool isParallel(const L2& b) const { return dir() * b.dir() == 0; }
  bool isBetter(const L2& b) const {
    assert(isParallel(b));
    return (b.one - one) * (two - one) < 0;
  }
  bool isBelow(const L2& a, const L2& c) const {
    return get_coeff(a) >= get_coeff(c);
  }
  pair<long double, long double> intersect(const L2& b) const {
    long double r = get_coeff(b);
    return make_pair(one.x + r * (two - one).x, one.y + r * (two - one).y);
  }
};
debug& operator<<(debug& dd, L2 line) {
  dd << make_pair(line.one, line.two);
  return dd;
}
deque<L2> getHull(vector<L2> halfplanes) {
  sort(halfplanes.begin(), halfplanes.end());
  debug() << " ["
          << "halfplanes"
             ": "
          << (halfplanes) << "] ";
  deque<L2> hull;
  for (L2 line : halfplanes) {
    if (!hull.empty() && line.isParallel(hull.back())) {
      if (hull.back().isBetter(line)) line = hull.back();
      hull.pop_back();
    }
    while ((int)hull.size() >= 2 &&
           hull.back().isBelow(hull[(int)hull.size() - 2], line))
      hull.pop_back();
    hull.push_back(line);
  }
  while ((int)hull.size() >= 3) {
    if (hull.back().isBelow(hull[(int)hull.size() - 2], hull[0]))
      hull.pop_back();
    else if (hull[0].isBelow(hull.back(), hull[1]))
      hull.pop_front();
    else
      break;
  }
  debug() << " ["
          << "hull"
             ": "
          << (hull) << "] ";
  return hull;
}
long double test_case() {
  int n;
  scanf("%d", &n);
  P origin;
  origin.read();
  vector<P> points(n - 1);
  for (P& p : points) {
    p.read();
    p = p - origin;
  }
  sort(points.begin(), points.end());
  debug() << " ["
          << "points"
             ": "
          << (points) << "] ";
  vector<L2> halfplanes;
  for (int i = 0; i < (int)points.size(); ++i) {
    int j = (i + 1) % points.size();
    halfplanes.push_back(L2{points[i], points[j]});
  }
  int pointer = 0;
  for (int i = 0; i < (int)points.size(); ++i) {
    pointer = max(pointer, i + 1);
    while (points[i] * points[pointer % points.size()] < 0) ++pointer;
    if (i != pointer % (int)points.size())
      halfplanes.push_back(L2{points[i], points[pointer % points.size()]});
  }
  debug() << " ["
          << "halfplanes"
             ": "
          << (halfplanes) << "] ";
  for (L2& line : halfplanes) {
    if (line.one * line.two == 0) return 0;
    if (line.one * line.two > 0) swap(line.one, line.two);
    line.one += origin;
    line.two += origin;
  }
  const int MAX = 1e6;
  vector<P> corners{P{-MAX, MAX}, P{MAX, MAX}, P{MAX, -MAX}, P{-MAX, -MAX}};
  for (int i = 0; i < (int)corners.size(); ++i) {
    int j = (i + 1) % corners.size();
    halfplanes.push_back(L2{corners[i], corners[j]});
  }
  deque<L2> hull = getHull(halfplanes);
  vector<pair<long double, long double>> polygon;
  long double area = 0;
  for (int i = 0; i < (int)hull.size(); ++i) {
    int j = (i + 1) % hull.size();
    polygon.push_back(hull[i].intersect(hull[j]));
  }
  cerr << polygon.size() << "\n";
  debug() << " ["
          << "polygon"
             ": "
          << (polygon) << "] ";
  for (int i = 0; i < (int)polygon.size(); ++i) {
    int j = (i + 1) % polygon.size();
    area += polygon[i].first * polygon[j].second -
            polygon[i].second * polygon[j].first;
  }
  return abs(area) / 2;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) printf("%.12lf\n", (double)test_case());
}