#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x1fffffffffffffff;
const double INFD = 1e20;
const double EPS = 1e-9;
const double PI = atan(1) * 4;
const long long M = 1000000007;
long long scan() {
  long long r;
  scanf("%lld", &r);
  return r;
}
void scanstr(char *buf) { scanf("%s", buf); }
const long long N = 100000;
long long n;
long long prnt[N];
long long ldv0[N];
long long lgst[N];
long long com[N];
long long comsize[N];
long long comroot[N];
long long comn = 0;
long long helloed[N];
vector<long long> nb[N];
vector<long long> sons[N];
vector<long long> f[N];
vector<long long> bsuf[N];
void dfs(long long parent, long long v, long long ci) {
  prnt[v] = parent;
  helloed[v] = 1;
  com[v] = ci;
  vector<long long> sonldvs;
  for (auto nxtv : nb[v]) {
    if (helloed[nxtv]) continue;
    dfs(v, nxtv, ci);
    sons[v].push_back(nxtv);
    sonldvs.push_back(ldv0[nxtv]);
  }
  long long sonn = sons[v].size();
  long long lds0 = -1;
  for (long long i = 0; i < sonn; ++i) {
    if (lds0 < 0 || ldv0[lds0] < sonldvs[i]) lds0 = sons[v][i];
  }
  ldv0[v] = (lds0 < 0) ? 0 : (ldv0[lds0] + 1);
}
void dfs2(long long v, long long prntstg) {
  lgst[v] = max(ldv0[v], 1 + prntstg);
  long long sn = sons[v].size();
  vector<long long> tl(sn + 1, -INF);
  vector<long long> tr(sn + 1, -INF);
  for (long long i = 1; i < sn + 1; ++i) {
    tl[i] = max(tl[i - 1], ldv0[sons[v][i - 1]]);
    tr[i] = max(tr[i - 1], ldv0[sons[v][sn - i]]);
  }
  for (long long i = 0; i < sn; ++i) {
    dfs2(sons[v][i], max(0LL, 1 + max(prntstg, max(tl[i], tr[sn - 1 - i]))));
  }
}
double calc(const vector<long long> &a, const vector<long long> &b,
            const vector<long long> &bsuf) {
  long long an = a.size();
  long long bn = b.size();
  long long bar = max(a[an - 1], b[bn - 1]);
  long long acc = 0;
  for (long long ai = 0; ai < an; ++ai) {
    long long bi = lower_bound(b.begin(), b.end(), bar - a[ai] - 1) - b.begin();
    acc += bar * bi + bsuf[bn - bi] + (bn - bi) * (a[ai] + 1);
  }
  return acc / double(an * bn);
}
int main() {
  n = scan();
  long long m = scan();
  long long q = scan();
  for (long long i = 0; i < m; ++i) {
    long long x = scan() - 1, y = scan() - 1;
    nb[x].push_back(y);
    nb[y].push_back(x);
  }
  for (long long i = 0; i < n; ++i) {
    if (helloed[i]) continue;
    dfs(-1, i, comn);
    comroot[comn++] = i;
  }
  for (long long i = 0; i < n; ++i) {
    ++comsize[com[i]];
  }
  for (long long i = 0; i < comn; ++i) {
    dfs2(comroot[i], -INF);
  }
  for (long long i = 0; i < n; ++i) {
    f[com[i]].push_back(lgst[i]);
  }
  for (long long i = 0; i < comn; ++i) {
    sort(f[i].begin(), f[i].end());
    long long bn = comsize[i];
    bsuf[i].resize(bn + 1);
    for (long long j = 1; j < bn + 1; ++j) {
      bsuf[i][j] = bsuf[i][j - 1] + f[i][bn - j];
    }
  }
  map<long long, double> mem;
  for (long long qi = 0; qi < q; ++qi) {
    long long x = scan() - 1, y = scan() - 1;
    long long X = com[x];
    long long Y = com[y];
    if (X == Y) {
      printf("-1\n");
      continue;
    }
    long long key = (X < Y) ? (X * comn + Y) : (Y * comn + X);
    double ans;
    if (mem.find(key) == mem.end()) {
      if (comsize[X] > comsize[Y]) swap(X, Y);
      ans = calc(f[X], f[Y], bsuf[Y]);
      mem[key] = ans;
    } else {
      ans = mem[key];
    }
    printf("%.9f\n", ans);
  }
  return 0;
}
