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 int mxn = 200010;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
struct point {
  double x, y;
  point() {}
  point(double _x, double _y) : x(_x), y(_y) {}
  point operator+(const point &b) { return point(x + b.x, y + b.y); }
  point operator-(const point &b) { return point(x - b.x, y - b.y); }
} a[mxn << 1];
inline double Cross(const point &a, const point &b) {
  return a.x * b.y - a.y * b.x;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int n;
double pw2[mxn];
double area = 0, lower = 0, smm = 0;
double egcnt = 0;
int main() {
  int i, j, k;
  n = read();
  pw2[0] = 1;
  for (i = n; i; i--) {
    a[i].x = read();
    a[i].y = read();
  }
  for (i = 1; i <= n; i++) {
    pw2[i] = pw2[i - 1] * 2;
    a[i + n] = a[i];
  }
  lower = pw2[n] - (long long)n * (n - 1) * 0.5 - n - 1;
  a[0] = a[n];
  for (i = 1; i <= n; i++)
    egcnt += gcd(abs(a[i].x - a[i - 1].x), abs(a[i].y - a[i - 1].y));
  for (i = 1; i <= n; i++) {
    area += Cross(a[i], a[i - 1]) * 0.5;
    double S = 0.0;
    double pcnt = gcd(abs(a[i + 1].x - a[i].x), abs(a[i + 1].y - a[i].y));
    for (j = i + 2, k = 2; k <= 37; k++, j++) {
      if (j > n) j -= n;
      if (j + 1 == i || j + 1 == i + n) break;
      S += Cross(a[j - 1] - a[i], a[j] - a[i]) * 0.5;
      pcnt += gcd(abs(a[j].x - a[j - 1].x), abs(a[j].y - a[j - 1].y));
      double B = pcnt + gcd(abs(a[j].x - a[i].x), abs(a[j].y - a[i].y));
      double ano = 1.0 / pw2[k + 1];
      if (n <= 100) ano = (pw2[n - k - 1] - 1) / lower;
      smm += (abs(S) - B * 0.5 + 1 + (B - pcnt - 1)) * ano;
    }
  }
  double ans = (area - egcnt * 0.5 + 1) - smm;
  printf("%.10lf\n", ans);
  return 0;
}