Problem: Gerald got tired of playing board games with the usual six-sided die, and he bought a toy called Randomizer. It functions as follows.

A Randomizer has its own coordinate plane on which a strictly convex polygon is painted, the polygon is called a basic polygon. If you shake a Randomizer, it draws some nondegenerate (i.e. having a non-zero area) convex polygon with vertices at some vertices of the basic polygon. The result of the roll (more precisely, the result of the shaking) is considered to be the number of points with integer coordinates, which were strictly inside (the points on the border are not considered) the selected polygon. Now Gerald is wondering: what is the expected result of shaking the Randomizer?

During the shaking the Randomizer considers all the possible non-degenerate convex polygons with vertices at the vertices of the basic polygon. Let's assume that there are k versions of the polygons. Then the Randomizer chooses each of them with probability <image>.

Input

The first line of the input contains a single integer n (3 ≤ n ≤ 100 000) — the number of vertices of the basic polygon. 

Next n lines contain the coordinates of the vertices of the basic polygon. The i-th of these lines contain two integers xi and yi ( - 109 ≤ xi, yi ≤ 109) — the coordinates of the i-th vertex of the polygon. The vertices are given in the counter-clockwise order.

Output

Print the sought expected value with absolute or relative error at most 10 - 9.

Examples

Input

4
0 0
2 0
2 2
0 2


Output

0.2


Input

5
0 0
2 0
2 2
1 3
0 2


Output

0.8125

Note

A polygon is called strictly convex if it is convex and no its vertices lie on the same line.

Let's assume that a random variable takes values x1, ..., xn with probabilities p1, ..., pn, correspondingly. Then the expected value of this variable equals to <image>.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265359;
template <typename T>
T abs(T x) {
  return x > 0 ? x : -x;
}
template <typename T>
T sqr(T x) {
  return x * x;
}
const long long maxn = 200005;
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
long long onSide(const pair<long long, long long> &a,
                 const pair<long long, long long> &b) {
  if (a.first == b.first) {
    return abs(a.second - b.second) - 1;
  } else if (a.second == b.second) {
    return abs(a.first - b.first) - 1;
  } else {
    return gcd(abs(a.first - b.first), abs(a.second - b.second)) - 1;
  }
}
long double p22[300];
long double p2(long long x) { return p22[min(x, 70LL)]; }
int main() {
  p22[0] = 1;
  for (int i = 1; i < 100; i++) {
    p22[i] = p22[i - 1] * 2;
  }
  int n;
  scanf("%d", &n);
  vector<pair<long long, long long>> a;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    a.push_back(make_pair(x, y));
  }
  long double ans = 0.0;
  long double areaAll = 0;
  long double onGAll = 0;
  for (int i = 0; i < n; i++) {
    auto u = a[i], v = a[(i + 1) % n];
    areaAll += (u.first + v.first) * (u.second - v.second);
    onGAll += onSide(u, v);
  }
  areaAll = abs(areaAll);
  areaAll /= 2;
  onGAll += n;
  long double cntAll = areaAll + 1 - onGAll / 2.0;
  ans = cntAll;
  const int ub = 40;
  for (int i = 0; i < n; i++) {
    long double currS = 0.0, currA = 0.0;
    for (int j = 1; j <= min(n - 2, ub); j++) {
      auto u = a[(i + j - 1) % n];
      auto v = a[(i + j) % n];
      currS += onSide(u, v);
      currA += (u.first + v.first) * (u.second - v.second) / 2.0;
      long double w = onSide(v, a[i]);
      currS += w;
      currA += (v.first + a[i].first) * (v.second - a[i].second) / 2.0;
      currS += 1 + j;
      if (j == 1) {
        currS -= w;
      }
      if (j > 1) {
        long double x = abs(currA) + 1 - currS / 2.0;
        x += w;
        long double p = p2(j + 1) - max(1e-30l, (n * (n - 1) / 2.0 + n + 1) /
                                                    p2(n - (j + 1)));
        p = 1.0 / p;
        p -= max(1e-30l, 1.0 / (p2(n) - n * (n - 1) / 2.0 - n - 1));
        ans -= x * p;
      }
      if (j == 1) {
        currS += w;
      }
      currS -= 1 + j;
      currA -= (v.first + a[i].first) * (v.second - a[i].second) / 2.0;
      currS -= w;
    }
  }
  cout.precision(12);
  cout << fixed << ans << endl;
  return 0;
}