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 MAXN = 100000 + 10;
const int EPS = 100;
struct Point {
  double x, y;
} P[MAXN], L, R, T;
Point operator-(Point& A, Point& B) { return (Point){A.x - B.x, A.y - B.y}; }
long long Gcd(long long a, long long b) { return b == 0 ? a : Gcd(b, a % b); }
double Cross(Point A, Point B) { return A.x * B.y - A.y * B.x; }
double p2[MAXN], Ans, Base, Area, S;
int N;
long long pcnt, cur, bdcnt;
int main() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  scanf("%d", &N);
  p2[0] = 1.0;
  for (int i = 0; i < N; ++i) {
    scanf("%lf%lf", &P[i].x, &P[i].y);
    p2[i + 1] = p2[i] * 2.0;
  }
  Base = p2[N] - 1 - N - 0.5 * N * (N - 1);
  R = P[N - 1] - P[0];
  bdcnt += Gcd(abs(R.x), abs(R.y));
  R = P[1] - P[0];
  bdcnt += Gcd(abs(R.x), abs(R.y));
  for (int i = 2; i < N; ++i) {
    L = P[i] - P[0];
    T = P[i] - P[i - 1];
    Area += Cross(R, L) * 0.5;
    bdcnt += Gcd(abs(T.x), abs(T.y));
    R = L;
  }
  for (int i = 0; i < N; ++i) {
    R = P[((i + 1) % N)] - P[i];
    pcnt = Gcd(abs(R.x), abs(R.y));
    S = 0;
    for (int j = ((((i + 1) % N) + 1) % N), k = 2;
         k <= 65 && ((j + 1) % N) != i; ++k, j = ((j + 1) % N)) {
      L = P[j] - P[i];
      T = L - R;
      pcnt += (cur = Gcd(abs(L.x), abs(L.y))) + Gcd(abs(T.x), abs(T.y));
      S += Cross(R, L) * 0.5;
      Ans += ((S + 1.0 - (pcnt)*0.5) + (((j + 1) % N) == i ? 0 : cur - 1)) *
             (N > EPS ? 1.0 / p2[k + 1] : ((p2[N - (k)-1] - 1.0) / Base));
      R = L;
      pcnt -= cur;
    }
  }
  printf("%.10lf", (Area + 1.0 - (bdcnt)*0.5) - Ans);
  return 0;
}