#include <bits/stdc++.h>
using namespace std;
int n, nb, x, y, m, np;
long double ansn;
struct ju {
  long double a[210][210];
} ch[18];
struct xiang {
  long double a[210];
} yu;
struct Po {
  int x, y, we;
} a[210], b[210];
bool vi[210][210];
vector<int> p[40010];
bool comp(const Po &a, const Po &b) {
  return 1.0 * a.x / a.y > 1.0 * b.x / b.y;
}
ju cheng(ju x, ju y) {
  ju z;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      z.a[i][j] = 0;
      for (int k = 1; k <= n; k++) {
        z.a[i][j] += x.a[i][k] * y.a[k][j];
      }
    }
  }
  return z;
}
xiang chen(xiang x, ju y) {
  xiang z;
  for (int i = 1; i <= n; i++) {
    z.a[i] = 0;
    for (int j = 1; j <= n; j++) {
      z.a[i] += x.a[j] * y.a[i][j];
    }
  }
  return z;
}
void po(xiang &x, int y) {
  int k = 1;
  while (y) {
    if (y % 2 == 1) x = chen(x, ch[k]);
    y /= 2;
    k++;
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d %d", &a[i].x, &a[i].y);
  for (int i = 1; i <= n; i++) {
    nb = 0;
    for (int j = 1; j <= n; j++)
      if (j != i) {
        b[++nb].x = a[j].x - a[i].x;
        b[nb].y = a[j].y - a[i].y;
        b[nb].we = j;
      }
    for (int j = 1; j <= nb; j++)
      if (b[j].x < 0) {
        b[j].x = 0 - b[j].x;
        b[j].y = 0 - b[j].y;
      }
    sort(b + 1, b + nb + 1, comp);
    int sum = 0;
    for (int l = 1, r = 0; l <= nb; l = r + 1) {
      while (r < nb && b[r + 1].x * b[l].y == b[l].x * b[r + 1].y) r++;
      sum++;
    }
    for (int l = 1, r = 0; l <= nb; l = r + 1) {
      while (r < nb && b[r + 1].x * b[l].y == b[l].x * b[r + 1].y) r++;
      for (int j = l; j <= r; j++) {
        ch[1].a[i][b[j].we] += 1.0 / sum / (r - l + 2);
      }
      ch[1].a[i][i] += 1.0 / sum / (r - l + 2);
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i < j)
        vi[i][j] = true;
      else
        vi[i][j] = false;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (vi[i][j]) {
        p[++np].push_back(i);
        p[np].push_back(j);
        for (int k = j + 1; k <= n; k++)
          if ((a[i].x - a[j].x) * (a[i].y - a[k].y) ==
              (a[i].x - a[k].x) * (a[i].y - a[j].y))
            p[np].push_back(k);
        for (int l = 0; l < p[np].size(); l++)
          for (int k = l + 1; k < p[np].size(); k++)
            vi[p[np][l]][p[np][k]] = false;
      }
    }
  }
  for (int i = 2; i <= 14; i++) ch[i] = cheng(ch[i - 1], ch[i - 1]);
  cin >> m;
  while (m--) {
    ansn = 0;
    cin >> y >> x;
    for (int i = 1; i <= n; i++)
      if (i == y)
        yu.a[i] = 1;
      else
        yu.a[i] = 0;
    po(yu, x - 1);
    for (int i = 1; i <= np; i++) {
      long double sum = 0;
      for (int k = 0; k < p[i].size(); k++)
        sum = sum + yu.a[p[i][k]] / p[i].size();
      ansn = max(ansn, sum);
    }
    po(yu, 1);
    for (int i = 1; i <= n; i++) ansn = max(ansn, yu.a[i]);
    printf("%.12Lf\n", ansn);
  }
}
