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;
struct point {
  int x, y;
  void scan() { scanf("%d%d", &x, &y); }
} x[110000];
int n, lim = 60;
long double two[1100];
long long cross(point k1, point k2) {
  return 1ll * k1.x * k2.y - 1ll * k1.y * k2.x;
}
int gcd(int k1, int k2) {
  if (k2 == 0) return k1;
  return gcd(k2, k1 % k2);
}
void force() {
  long double tot = 1;
  for (int i = 1; i <= n; i++) tot = tot * 2;
  tot -= 1 + n + n * (n - 1) / 2;
  two[0] = 1;
  for (int i = 1; i <= n; i++) two[i] = two[i - 1] * 2;
  long double ans = 0;
  for (int i = 1; i <= n; i++) {
    long long pre = 0, now = 1;
    int k1 = i, k2 = i % n + 1, rem = n - 2;
    for (int j = 1; j < n; j++) {
      pre += cross(x[k1], x[k2]);
      int k3 = gcd(abs(x[k1].x - x[k2].x), abs(x[k1].y - x[k2].y));
      now += k3;
      k3 = gcd(abs(x[k2].x - x[i].x), abs(x[k2].y - x[i].y));
      long long k4 = pre + cross(x[k2], x[i]), k5 = now + k3 - 1;
      k4 = (k4 + k5) / 2;
      if (j == 1) k4 = k3;
      if (i == 1 && j == n - 1) {
        ans += k4 + 1;
      } else if (j < n - 1) {
        ans -= (k4) * (two[rem] - 1) / tot;
      }
      k1 = (k1 % n + 1);
      k2 = k2 % n + 1;
      rem--;
    }
  }
  printf("%.11lf\n", (double)ans);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) x[i].scan();
  if (n <= 1000) {
    force();
    return 0;
  }
  two[1] = 0.25;
  for (int i = 2; i <= lim; i++) two[i] = two[i - 1] / 2.0;
  long double ans = 0;
  for (int i = 1; i <= n; i++) {
    long long pre = 0, now = 1;
    int k1 = i, k2 = i % n + 1, rem = n - 2;
    int r = lim;
    if (i == 1) r = n;
    for (int j = 1; j < r; j++) {
      pre += cross(x[k1], x[k2]);
      int k3 = gcd(abs(x[k1].x - x[k2].x), abs(x[k1].y - x[k2].y));
      now += k3;
      k3 = gcd(abs(x[k2].x - x[i].x), abs(x[k2].y - x[i].y));
      long long k4 = pre + cross(x[k2], x[i]), k5 = now + k3 - 1;
      k4 = (k4 + k5) / 2;
      if (j == 1) k4 = k3;
      if (i == 1 && j == n - 1) {
        ans += k4 + 1;
      } else if (j < lim) {
        ans -= (k4)*two[j];
      }
      k1 = (k1 % n + 1);
      k2 = k2 % n + 1;
      rem--;
    }
  }
  printf("%.11lf\n", (double)ans);
}