#include <bits/stdc++.h>
using namespace std;
int n, Q, T, P, used[210][210], cnt[210];
struct dot {
  int x, y;
} a[210];
double mat[14 + 2][210][210], cur[210][2], tmp[210][2], ans;
vector<vector<int> > l;
vector<int> curr;
dot operator-(dot a, dot b) {
  a.x -= b.x, a.y -= b.y;
  return a;
}
long long operator*(dot a, dot b) { return 1ll * a.x * b.y - 1ll * a.y * b.x; }
template <typename T>
void chkmax(T &x, T y) {
  x = max(x, y);
}
template <typename T>
void chkmin(T &x, T y) {
  x = min(x, y);
}
template <typename T>
void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
bool on_line(dot a, dot x, dot y) { return (((a - x) * (a - y)) == 0); }
void work() {
  unsigned si = curr.size();
  for (unsigned i = 0; i < si; ++i)
    for (unsigned j = 0; j < i; ++j)
      used[curr[i]][curr[j]] = used[curr[j]][curr[i]] = 1;
}
int main() {
  read(n);
  for (int i = 1; i <= n; ++i) read(a[i].x), read(a[i].y);
  for (int i = 1; i <= n; ++i) used[i][i] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j < i; ++j) {
      if (used[i][j]) continue;
      curr.clear();
      curr.push_back(i);
      curr.push_back(j);
      for (int t = 1; t <= n; ++t) {
        if (t == i || t == j) continue;
        if (on_line(a[t], a[i], a[j])) curr.push_back(t);
      }
      work();
      l.push_back(curr);
      for (unsigned t = 0, si = curr.size(); t < si; ++t) ++cnt[curr[t]];
    }
  for (unsigned i = 0; i < l.size(); ++i) {
    int tot = l[i].size();
    for (unsigned j = 0; j < (unsigned)tot; ++j)
      for (unsigned t = 0; t < (unsigned)tot; ++t) {
        int u = l[i][j], v = l[i][t];
        mat[0][u][v] += 1.0 / (cnt[u] * tot);
      }
  }
  for (int p = 1; p <= 14; ++p)
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        for (int t = 1; t <= n; ++t)
          mat[p][i][j] += mat[p - 1][i][t] * mat[p - 1][t][j];
  read(Q);
  while (Q--) {
    ans = 0;
    read(T), read(P);
    memset(cur, 0, sizeof(cur));
    cur[T][1] = 1;
    for (int p = 0; p <= 14; ++p)
      if ((P - 1) & (1 << p)) {
        memset(tmp, 0, sizeof(tmp));
        for (int i = 1; i <= n; ++i)
          for (int j = 1; j <= 1; ++j)
            for (int t = 1; t <= n; ++t) tmp[i][j] += mat[p][i][t] * cur[t][j];
        for (int i = 1; i <= n; ++i)
          for (int j = 1; j <= 1; ++j) cur[i][j] = tmp[i][j];
      }
    for (unsigned i = 0; i < l.size(); ++i) {
      double tot = 0;
      for (unsigned j = 0; j < l[i].size(); ++j) {
        tot += cur[l[i][j]][1];
      }
      chkmax(ans, tot / l[i].size());
    }
    printf("%.10lf\n", ans);
  }
  return 0;
}
