#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int INF = (int)1e9;
const int MAXN = 100500;
const int C = 2154;
int n, m, q;
vector<int> g[MAXN];
int ptr, id[MAXN], h[MAXN], high;
int sz[MAXN], diam[2][MAXN], dist[2][MAXN], maxH[MAXN];
int idf[MAXN];
vector<int> comp[MAXN];
int hcnt[MAXN];
vector<int> c[MAXN];
vector<long long> s[MAXN];
vector<int> BIG;
long long prec[111][111];
void dfs(int v, int pv) {
  id[v] = ptr;
  sz[ptr]++;
  comp[ptr].push_back(v);
  for (auto w : g[v]) {
    if (w != pv) {
      dfs(w, v);
    }
  }
}
void dfs2(int v, int pv, int H) {
  h[v] = H;
  if (h[high] < h[v]) {
    high = v;
  }
  for (auto w : g[v]) {
    if (w != pv) {
      dfs2(w, v, H + 1);
    }
  }
}
void dfs3(int v, int pv, int id, int H) {
  dist[id][v] = H;
  for (auto w : g[v]) {
    if (w != pv) {
      dfs3(w, v, id, H + 1);
    }
  }
}
long long calc(int a, int b) {
  int D = max(dist[0][diam[1][a]], dist[0][diam[1][b]]);
  long long sum = 0;
  for (auto v : comp[a]) {
    sum += 1ll * (maxH[v] + 1) * c[b][D - maxH[v]] + s[b][D - maxH[v]];
  }
  for (auto v : comp[a]) {
    sum += 1ll * D * max(0, sz[b] - c[b][D - maxH[v]]);
  }
  return sum;
}
int main() {
  cin >> n >> m >> q;
  for (int i = 0; i < (int)(m); i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  memset(id, -1, sizeof(id));
  ptr = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (id[i] == -1) {
      h[i] = 0;
      high = i;
      dfs(i, -1);
      diam[1][ptr] = i;
      for (int j = 0; j < (int)(3); j++) {
        diam[0][ptr] = diam[1][ptr];
        high = diam[0][ptr];
        dfs2(diam[0][ptr], -1, 0);
        diam[1][ptr] = high;
      }
      for (int j = 0; j < (int)(2); j++) {
        dfs3(diam[j][ptr], -1, j, 0);
      }
      if (sz[ptr] >= C) {
        idf[ptr] = (int)BIG.size();
        BIG.push_back(ptr);
      }
      int idc = id[i];
      for (int j = 0; j <= sz[idc]; j++) {
        hcnt[j] = 0;
      }
      for (auto v : comp[idc]) {
        maxH[v] = max(dist[0][v], dist[1][v]);
        hcnt[maxH[v]]++;
      }
      c[idc].resize(sz[idc] + 1, 0);
      s[idc].resize(sz[idc] + 1, 0);
      for (int j = sz[idc] - 1; j >= 0; j--) {
        c[idc][j] = c[idc][j + 1] + hcnt[j];
        s[idc][j] = s[idc][j + 1] + 1ll * hcnt[j] * j;
      }
      assert(c[idc][0] == sz[idc]);
      ptr++;
    }
  }
  for (int i = 0; i < (int)(BIG.size()); i++) {
    for (int j = 0; j < (int)(BIG.size()); j++) {
      prec[i][j] = calc(BIG[i], BIG[j]);
    }
  }
  for (int i = 0; i < (int)(q); i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    a = id[a];
    b = id[b];
    if (a == b) {
      printf("-1\n");
    } else {
      if (sz[a] > sz[b]) {
        swap(a, b);
      }
      double ans;
      if (sz[a] < C) {
        ans = calc(a, b);
      } else {
        ans = prec[idf[a]][idf[b]];
      }
      ans /= sz[a];
      ans /= sz[b];
      printf("%.10f\n", ans);
    }
  }
  return 0;
}
