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 = 1e5 + 5;
int N;
pair<long long, long long> a[maxN];
inline long long Gcd(long long x, long long y) { return y ? Gcd(y, x % y) : x; }
void init() {
  cin >> N;
  for (int i = (1), _end = (N); i <= _end; ++i)
    cin >> a[i].first >> a[i].second;
  reverse(a + 1, a + 1 + N);
}
double pro[maxN];
double pw2[maxN];
inline double Cross(pair<long long, long long> A,
                    pair<long long, long long> B) {
  return A.first * B.second - A.second * B.first;
}
int GetBnd(pair<long long, long long> A, pair<long long, long long> B) {
  return Gcd(abs(A.first - B.first), abs(A.second - B.second)) + 1;
}
void solve() {
  double ans = 0;
  int len = min(65, N - 1);
  pw2[0] = 1;
  for (int i = (1), _end = (100); i <= _end; ++i) pw2[i] = pw2[i - 1] * 2;
  if (N >= 50) {
    for (int i = (1), _end = (len); i <= _end; ++i) {
      pro[i] = 1. / pw2[i + 1];
    }
  } else {
    for (int i = (1), _end = (len); i <= _end; ++i) {
      pro[i] =
          (pw2[N - i - 1] - 1) / (pw2[N] - 1 - N - (double)N * (N - 1) / 2);
    }
  }
  double Area = .0, BndCnt = .0;
  for (int i = (1), _end = (N); i <= _end; ++i) {
    if (i >= 3)
      Area += (double)-Cross(
          make_pair(a[((i - 1 - 1 + N) % N + 1)].first - a[1].first,
                    a[((i - 1 - 1 + N) % N + 1)].second - a[1].second),
          make_pair(a[i].first - a[1].first, a[i].second - a[1].second));
    BndCnt += (double)GetBnd(a[i], a[((i + 1 - 1 + N) % N + 1)]);
  }
  ans = (Area - BndCnt + N) / 2 + 1;
  for (int i = (1), _end = (N); i <= _end; ++i) {
    long long bndcnt = 0, area = 0;
    for (int j = (1), _end = (65); j <= _end; ++j) {
      area += Cross(
          make_pair(a[((i + j - 1 + N) % N + 1)].first - a[i].first,
                    a[((i + j - 1 + N) % N + 1)].second - a[i].second),
          make_pair(a[((i + j - 1 - 1 + N) % N + 1)].first - a[i].first,
                    a[((i + j - 1 - 1 + N) % N + 1)].second - a[i].second));
      bndcnt += GetBnd(a[((i + j - 1 - 1 + N) % N + 1)],
                       a[((i + j - 1 + N) % N + 1)]);
      if (((i + j - 1 + N) % N + 1) == ((i - 1 - 1 + N) % N + 1)) break;
      if (j != 1) {
        long long tmp = GetBnd(a[i], a[((i + j - 1 + N) % N + 1)]);
        long long lover = bndcnt + tmp - j - 1;
        ans -= (tmp - 2 + (area - lover) / 2 + 1) * pro[j];
      }
    }
  }
  printf("%.20f\n", ans);
}
int main() {
  ios::sync_with_stdio(false);
  init();
  solve();
  return 0;
}