#include <bits/stdc++.h>
using namespace std;
int n, m, q, x, y, scc, block;
vector<int> v[200005];
int belong[200005], deep[200005][3], dist[200005];
vector<int> f[200005];
vector<long long> sumf[200005];
int maxdis[200005];
int id[200005], fid[200005];
long long ans[5005][5005];
int getpos(int id, int w) {
  int l = 0, mid, r = f[id].size() - 1, ans = -1;
  while (l <= r) {
    mid = (l + r) / 2;
    if (f[id][mid] >= w) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ans;
}
long long calc(int x, int y) {
  long long sum = 0;
  if (f[x].size() > f[y].size()) swap(x, y);
  long long maxd = max(f[x][0], f[y][0]);
  for (int i = 0; i < f[x].size(); ++i) {
    int xx, yy;
    xx = f[x][i];
    yy = getpos(y, maxd - 1 - xx);
    if (yy == -1)
      sum += 1LL * f[y].size() * maxd;
    else {
      sum += 1LL * (f[y].size() - 1 - yy) * maxd;
      sum += 1LL * (yy + 1) * (xx + 1);
      sum += sumf[y][yy];
    }
  }
  return sum;
}
void dfs1(int x, int fa) {
  belong[x] = scc;
  f[scc].push_back(x);
  deep[x][1] = deep[x][2] = 0;
  for (int i = 0; i < v[x].size(); ++i) {
    int y = v[x][i];
    if (y == fa) continue;
    dfs1(y, x);
    if (deep[y][1] + 1 > deep[x][1]) {
      deep[x][2] = deep[x][1];
      deep[x][1] = deep[y][1] + 1;
    } else if (deep[y][1] + 1 > deep[x][2]) {
      deep[x][2] = deep[y][1] + 1;
    }
  }
}
void dfs2(int x, int fa) {
  dist[x] = dist[fa];
  if (deep[x][1] + 1 == deep[fa][1]) {
    if (deep[fa][2] > dist[x]) dist[x] = deep[fa][2];
  } else {
    if (deep[fa][1] > dist[x]) dist[x] = deep[fa][1];
  }
  if (fa != 0) dist[x]++;
  if (fa == 0) dist[x] = 0;
  for (int i = 0; i < v[x].size(); ++i) {
    int y = v[x][i];
    if (y == fa) continue;
    dfs2(y, x);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) belong[i] = -1;
  for (int i = 1; i <= n; ++i) {
    if (belong[i] != -1) continue;
    ++scc;
    dfs1(i, 0);
    dist[0] = 0;
    dfs2(i, 0);
    for (int j = 0; j < f[scc].size(); ++j) {
      x = f[scc][j];
      maxdis[x] = max(dist[x], deep[x][1]);
      f[scc][j] = maxdis[x];
    }
    sort(f[scc].begin(), f[scc].end());
    reverse(f[scc].begin(), f[scc].end());
    sumf[scc].push_back(f[scc][0]);
    for (int j = 1; j < f[scc].size(); ++j)
      sumf[scc].push_back(sumf[scc][j - 1] + f[scc][j]);
  }
  block = (int)sqrt(1.0 * n);
  int num = 0;
  for (int i = 1; i <= scc; ++i) {
    if (f[i].size() > block) {
      ++num;
      id[i] = num;
      fid[num] = i;
    }
  }
  for (int i = 1; i <= num; ++i)
    for (int j = i + 1; j <= num; ++j)
      ans[i][j] = ans[j][i] = calc(fid[i], fid[j]);
  for (int z = 1; z <= q; ++z) {
    long long ret = 0;
    scanf("%d%d", &x, &y);
    if (belong[x] == belong[y]) {
      printf("-1\n");
      continue;
    }
    x = belong[x];
    y = belong[y];
    if (f[x].size() > block && f[y].size() > block)
      ret = ans[id[x]][id[y]];
    else {
      ret = calc(x, y);
    }
    double ANS = ret;
    ANS = ANS / f[x].size();
    ANS = ANS / f[y].size();
    printf("%.10f\n", ANS);
  }
  return 0;
}
