#include <bits/stdc++.h>
using namespace std;
int n;
int x[200], y[200];
double a[200][200];
const int lg = 14;
vector<vector<int>> p[200];
vector<vector<double>> st[14];
vector<vector<double>> mul(vector<vector<double>> a, vector<vector<double>> b) {
  int n = a.size();
  int m = a.front().size();
  int k = b.front().size();
  vector<vector<double>> result(n, vector<double>(k));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k; j++) {
      for (int t = 0; t < m; t++) {
        result[i][j] += a[i][t] * b[t][j];
      }
    }
  }
  return result;
}
vector<vector<double>> binpow(vector<vector<double>> n, int k) {
  if (k == 0) {
    vector<vector<double>> result(n.size(), vector<double>(n.size()));
    for (int i = 0; i < n.size(); i++) result[i][i] = 1;
    return result;
  }
  if (k & 1) return mul(binpow(n, k - 1), n);
  vector<vector<double>> t = binpow(n, k / 2);
  return mul(t, t);
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    char used[200] = {};
    used[i] = true;
    for (int j = 0; j < n; j++) {
      if (i != j) {
        if (used[j]) continue;
        cnt++;
        int x1 = x[i], y1 = y[i];
        int x2 = x[j], y2 = y[j];
        int _a = y2 - y1, _b = x1 - x2, _c = x2 * y1 - x1 * y2;
        int cnt = 0;
        for (int k = 0; k < n; k++) {
          if (x[k] * _a + y[k] * _b + _c == 0) cnt++;
        }
        double prob = 1.0 / cnt;
        p[i].push_back(vector<int>());
        for (int k = 0; k < n; k++) {
          if (x[k] * _a + y[k] * _b + _c == 0) {
            used[k] = true;
            p[i].back().push_back(k);
            a[i][k] += prob;
          }
        }
      }
    }
    for (int j = 0; j < n; j++) a[i][j] /= cnt;
  }
  vector<vector<double>> A(n, vector<double>(n));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) A[i][j] = a[i][j];
  st[0] = A;
  for (int i = 1; i < lg; i++) {
    st[i] = mul(st[i - 1], st[i - 1]);
  }
  int qu;
  cin >> qu;
  for (int i = 0; i < qu; i++) {
    int t, m;
    cin >> t >> m;
    t--;
    vector<vector<double>> fm(n, vector<double>(1));
    fm[t][0] = 1;
    int val = m - 1;
    for (int i = 13; i >= 0; i--) {
      if (val - (1 << i) >= 0) {
        val -= (1 << i);
        fm = mul(st[i], fm);
      }
    }
    double mx = 0;
    for (int v1 = 0; v1 < n; v1++) {
      for (auto &vec : p[v1]) {
        double sum = 0;
        for (auto u : vec) sum += fm[u][0];
        sum /= (vec.size());
        mx = max(mx, sum);
      }
    }
    cout << mx << endl;
  }
}
