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;
bool debug = 1;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
struct Point {
  long long x, y;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
  Point operator*(double o) const { return Point(x * o, y * o); }
  Point operator+(const Point& o) const { return Point(x + o.x, y + o.y); }
  Point operator-(const Point& o) const { return Point(x - o.x, y - o.y); }
  bool operator<(const Point& o) const {
    return x < o.x - 1e-9 || (x < o.x + 1e-9 && y < o.y - 1e-9);
  }
  long long cross(Point b) const { return x * b.y - b.x * y; }
  void readin() { scanf("%lld%lld", &x, &y); }
} p[100125];
long long gcd1(long long x, long long y) {
  if (x == 0) return y;
  if (y == 0) return x;
  long long z = y;
  while (x % y != 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return z;
}
pair<long long, long long> cal(int l, int r) {
  long long border = 0, inner = 0, s = 0;
  for (int i = l;; i = (i + 1) % n) {
    Point a = p[i], b = p[i == r ? l : (i + 1) % n];
    Point c = a - b;
    border += gcd1(abs(c.x), abs(c.y));
    s += a.cross(b);
    if (i == r) break;
  }
  assert((s + 2 - border) % 2 == 0);
  inner = (s + 2 - border) / 2;
  return {inner, border};
}
long long getInner(long long area2, long long border) {
  return (area2 + 2 - border) / 2;
}
void cal() {
  scanf("%d", &n);
  for (int(i) = 0; (i) < (int)(n); (i)++) p[i].readin();
  long long tt = cal(0, n - 1).first;
  double ans = 0;
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    long long border = 0, inner = 0, s = 0;
    Point a = p[i], b = p[(i + 1) % n], c = a - b;
    s += a.cross(b);
    border += gcd1(abs(c.x), abs(c.y));
    for (int j = (i + 2) % n, t = 0; t < 40; t++, j = (j + 1) % n) {
      if ((j + 1) % n == i) break;
      a = p[(j - 1 + n) % n];
      b = p[j];
      s += a.cross(b);
      c = a - b;
      border += gcd1(abs(c.x), abs(c.y));
      c = p[i] - p[j];
      long long X = gcd1(abs(c.x), abs(c.y)) - 1;
      long long pps = getInner(s + p[j].cross(p[i]), border + X + 1);
      pps += X;
      int bt = 1 + t + 2;
      double prob = 1;
      if (n <= 60) {
        prob = (double)((1LL << (n - bt)) - 1) /
               ((1LL << n) - 1 - n - n * (n - 1) / 2);
      } else {
        for (int(z) = 0; (z) < (int)(bt); (z)++) prob /= 2;
      }
      ans += prob * pps;
    }
  }
  printf("%.10lf\n", tt - ans);
}
int main() {
  cal();
  return 0;
}