#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 41;
int const M = 341;
vector<int> e[N];
vector<double> hAns;
map<pair<int, int>, int> h;
vector<int> dbpref[N], dbsuf[N], db[N];
vector<long long> sufSum[N];
int d[N], dCol[N];
int cnt, col[N], was[N], root[N];
vector<pair<int, int> > dists[N];
int n, m, q;
void dfs(int u) {
  was[u] = 1;
  col[u] = cnt;
  root[col[u]] = u;
  for (int i = 0; i < (int)(e[u].size()); ++i) {
    int to = e[u][i];
    if (!was[to]) dfs(to);
  }
}
int dfs1(int u, int p) {
  if (u == p) e[u].push_back(u);
  for (int i = 0; i < (int)(e[u].size()); ++i) {
    int to = e[u][i];
    if (to == p) {
      swap(e[u][i], e[u][0]);
    }
  }
  db[u].assign((int)(e[u].size()), 0);
  dbpref[u].assign((int)(e[u].size()), 0);
  dbsuf[u].assign((int)(e[u].size()), 0);
  for (int i = 1; i < (int)(e[u].size()); ++i) {
    int to = e[u][i];
    db[u][i] = dfs1(to, u) + 1;
  }
  for (int i = 1; i < (int)(e[u].size()); ++i) {
    dbpref[u][i] = max(dbpref[u][i - 1], db[u][i]);
  }
  for (int i = (int)(e[u].size()) - 1; i >= 0; --i) {
    dbsuf[u][i] = db[u][i];
    if (i + 1 < (int)(e[u].size())) {
      dbsuf[u][i] = max(dbsuf[u][i], dbsuf[u][i + 1]);
    }
  }
  return dbpref[u].back();
}
void dfs2(int u, int hi) {
  d[u] = max(hi, dbpref[u].back());
  dists[col[u]].push_back(make_pair(d[u], u));
  dCol[col[u]] = max(dCol[col[u]], d[u]);
  for (int i = 1; i < (int)(e[u].size()); ++i) {
    int to = e[u][i];
    int prefhi = dbpref[u][i - 1];
    int sufhi = (i + 1 < (int)(e[u].size()) ? dbsuf[u][i + 1] : 0);
    int nhi = 1 + max(hi, max(prefhi, sufhi));
    dfs2(to, nhi);
  }
}
pair<int, int> getHash(int c1, int c2) {
  return make_pair(min(c1, c2), max(c1, c2));
}
int getFirstPos(vector<pair<int, int> > &dists, int maxD, int startD) {
  int l = -1;
  int r = (int)(dists.size());
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (dists[m].first + startD > maxD)
      r = m;
    else
      l = m;
  }
  return r;
}
double solveSmall(int color1, int color2) {
  long long ret = 0;
  int maxD = max(dCol[color1], dCol[color2]);
  for (int i = 0; i < (int)(dists[color2].size()); ++i) {
    int firstPos = getFirstPos(dists[color1], maxD, dists[color2][i].first + 1);
    ret += firstPos * 1LL * maxD;
    ret += ((int)(dists[color1].size()) - firstPos) * 1LL *
           (dists[color2][i].first + 1);
    if (firstPos < (int)(dists[color1].size())) {
      ret += sufSum[color1][firstPos];
    }
  }
  return (ret * 1.0) /
         ((int)(dists[color1].size()) * 1LL * (int)(dists[color2].size()));
}
double solveLarge(int color1, int color2) {
  if (h.find(getHash(color1, color2)) != h.end()) {
    return hAns[h[getHash(color1, color2)]];
  } else {
    int msz = (int)(h.size());
    h[getHash(color1, color2)] = msz;
    hAns.push_back(solveSmall(color1, color2));
    return hAns.back();
  }
}
void buildSufSums(int cnt) {
  sort(dists[cnt].begin(), dists[cnt].end());
  long long sum = 0;
  sufSum[cnt].assign((int)(dists[cnt].size()), 0LL);
  for (int i = (int)(dists[cnt].size()) - 1; i >= 0; --i) {
    sum += dists[cnt][i].first;
    sufSum[cnt][i] = sum;
  }
}
void solve() {
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    --u;
    --v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  for (int i = 0; i < n; ++i) {
    if (!was[i]) {
      dfs(i);
      dfs1(root[cnt], root[cnt]);
      dfs2(root[cnt], 0);
      buildSufSums(cnt);
      ++cnt;
    }
  }
  for (int i = 0; i < q; ++i) {
    int v1, v2;
    scanf("%d %d", &v1, &v2);
    --v1;
    --v2;
    int color1 = col[v1];
    int color2 = col[v2];
    if (color1 == color2) {
      printf("-1\n");
      continue;
    }
    if ((int)(dists[color1].size()) < (int)(dists[color2].size())) {
      swap(color1, color2);
    }
    double ans;
    if ((int)(dists[color2].size()) >= M) {
      ans = solveLarge(color1, color2);
    } else {
      ans = solveSmall(color1, color2);
    }
    printf("%.15lf\n", ans);
  }
  return;
  for (int i = 0; i < cnt; ++i) {
    printf("root = %d\n", root[i]);
    for (int j = 0; j < (int)(dists[i].size()); ++j) {
      printf("ver = %d distance = %d\n", dists[i][j].second + 1,
             dists[i][j].first);
    }
    printf("\n");
  }
}
int main() {
  solve();
  return 0;
}
