#include <bits/stdc++.h>
using namespace std;
int c, ptr = -1;
long double mat[14][200 + 1][200 + 1], ans[200 + 1], tans[200 + 1];
int x[200 + 1], y[200 + 1];
vector<int> line[200 * 200 + 10];
bool cmp1(int a, int b) {
  return (x[a] - x[c]) * (y[b] - y[c]) == (x[b] - x[c]) * (y[a] - y[c]);
}
bool cmp(int a, int b) {
  int p = y[a] - y[c];
  int q = x[a] - x[c];
  int r = y[b] - y[c];
  int s = x[b] - x[c];
  if (q < 0) q *= -1, p *= -1;
  if (s < 0) s *= -1, r *= -1;
  if (!q) p = abs(p);
  if (!s) r = abs(r);
  return p * s < q * r;
}
vector<int> a;
int main() {
  int n, q, m, t;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  for (int i = 0; i < n; i++) {
    c = i;
    a.clear();
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      a.push_back(j);
    }
    sort(a.begin(), a.end(), cmp);
    int cnt = 0;
    for (int j = 0; j < a.size(); j++) {
      if (j == 0 || !cmp1(a[j], a[j - 1])) {
        cnt++;
      }
    }
    long double sum = 0.0;
    for (int j = 0; j < a.size();) {
      int k;
      for (k = j; k < a.size(); k++) {
        if (!cmp1(a[k], a[j])) break;
      }
      int x = k - j;
      line[++ptr].push_back(i);
      for (int l = k - 1; l >= j; l--) {
        line[ptr].push_back(a[l]);
        mat[0][i][a[l]] =
            1.0 / (long double)((long double)cnt * (long double)(x + 1));
      }
      sum += 1.0 / (long double)((long double)cnt * (long double)(x + 1));
      j = k;
    }
    mat[0][i][i] = sum;
  }
  for (int i = 1; i < 14; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++) {
        for (int l = 0; l < n; l++) {
          mat[i][j][k] += mat[i - 1][j][l] * mat[i - 1][l][k];
        }
      }
    }
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> t >> m;
    for (int j = 0; j < n; j++) {
      ans[j] = 0;
      tans[j] = 0;
    }
    m--;
    ans[--t] = 1.0;
    for (int j = 0; j < 14; j++, m >>= 1) {
      if (m & 1) {
        for (int k = 0; k < n; k++) {
          for (int l = 0; l < n; l++) {
            tans[k] += ans[l] * mat[j][k][l];
          }
        }
        for (int k = 0; k < n; k++) {
          ans[k] = tans[k];
          tans[k] = 0;
        }
      }
    }
    long double maxans = 0.0, tempans;
    for (int j = 0; j <= ptr; j++) {
      tempans = 0.0;
      for (int k = 0; k < line[j].size(); k++) {
        tempans += ans[line[j][k]];
      }
      tempans /= (long double)(line[j].size());
      maxans = max(maxans, tempans);
    }
    cout << fixed << setprecision(20) << maxans << endl;
  }
  return 0;
}
