#include <bits/stdc++.h>
using namespace std;
const long long MX = 200011, B = 500;
struct Edge {
  long long u, v;
} e[MX];
long long pool[MX], *G[MX];
long long D[MX], vis[MX];
long long n, m, q, bel[MX], dia[MX], mx[MX], smx[MX], mxf[MX], sz[MX], no[MX],
    tot;
double ans[MX];
long long ansvis[MX];
vector<long long> F[MX], C[MX];
vector<long long> S[MX];
void dfs(long long k, long long f, long long B) {
  bel[k] = B;
  vis[k] = 1;
  for (long long *i = G[k]; i != G[k + 1]; i++)
    if (*i != f) dfs(*i, k, B);
}
void dp1(long long k, long long f) {
  mx[k] = smx[k] = 0;
  for (long long *i = G[k]; i != G[k + 1]; i++) {
    if (*i != f) {
      dp1(*i, k);
      smx[k] = max(smx[k], mx[*i] + 1);
      if (smx[k] > mx[k]) swap(mx[k], smx[k]);
    }
  }
}
void dp2(long long k, long long f) {
  mxf[k] = 0;
  if (f) mxf[k] = max((mx[f] == mx[k] + 1) ? smx[f] : mx[f], mxf[f]) + 1;
  for (long long *i = G[k]; i != G[k + 1]; i++)
    if (*i != f) dp2(*i, k);
}
void gt(long long k, long long f, long long B) {
  sz[B]++;
  dia[B] = max(dia[B], max(mxf[k] + mx[k], mx[k] + smx[k]));
  for (long long *i = G[k]; i != G[k + 1]; i++)
    if (*i != f) gt(*i, k, B);
}
void gt2(long long k, long long f, long long B) {
  F[B][max(mx[k], mxf[k])]++;
  for (long long *i = G[k]; i != G[k + 1]; i++)
    if (*i != f) gt2(*i, k, B);
}
void wk(long long k) {
  dfs(k, 0, k);
  dp1(k, 0);
  dp2(k, 0);
  gt(k, 0, k);
  F[k].resize(dia[k] + 1);
  S[k].resize(dia[k] + 1);
  C[k].resize(dia[k] + 1);
  gt2(k, 0, k);
  for (long long i = 1; i <= dia[k]; i++)
    S[k][i] = S[k][i - 1] + (long long)i * F[k][i];
  C[k][0] = F[k][0];
  for (long long i = 1; i <= dia[k]; i++) C[k][i] = C[k][i - 1] + F[k][i];
}
double calc(long long u, long long v) {
  long long lm = max(dia[u], dia[v]);
  double tot = 0.0;
  for (long long i = 0; i <= dia[u]; i++) {
    tot += (double)F[u][i] *
           ((double)((lm - i - 1 < 0) ? 0 : C[v][min(lm - i - 1, dia[v])]) *
                (double)lm +
            (double)(i + 1) *
                (dia[v] > lm - i - 1
                     ? C[v][dia[v]] - ((lm - i - 1 < 0) ? 0 : C[v][lm - i - 1])
                     : 0) +
            (dia[v] > lm - i - 1
                 ? S[v][dia[v]] - ((lm - i - 1 < 0) ? 0 : S[v][lm - i - 1])
                 : 0));
  }
  return tot / (double)((long long)sz[u] * sz[v]);
}
int main() {
  scanf("%lld%lld%lld", &n, &m, &q);
  for (long long i = 1; i <= m; i++) {
    scanf("%lld%lld", &e[i].u, &e[i].v), ++D[e[i].u], ++D[e[i].v];
  }
  G[1] = pool;
  for (long long i = 1; i <= n; i++) G[i + 1] = G[i] + D[i];
  for (long long i = 1; i <= m; i++)
    G[e[i].u][--D[e[i].u]] = e[i].v, G[e[i].v][--D[e[i].v]] = e[i].u;
  for (long long i = 1; i <= n; i++)
    if (!vis[i]) wk(i);
  for (long long i = 1; i <= n; i++) {
    if (bel[i] == i && sz[i] > B) {
      no[i] = tot++;
    }
  }
  for (long long i = 1; i <= q; i++) {
    long long u, v;
    scanf("%lld%lld", &u, &v);
    if (bel[u] == bel[v])
      puts("-1");
    else {
      if (sz[bel[v]] < sz[bel[u]] || (sz[bel[v]] == sz[bel[u]] && u > v))
        swap(u, v);
      if (bel[u] > B) {
        printf("%.10f\n", (ansvis[no[bel[u]] * tot + no[bel[v]]]
                               ? ans[no[bel[u]] * tot + no[bel[v]]]
                               : (ans[no[bel[u]] * tot + no[bel[v]]] =
                                      calc(bel[u], bel[v]))));
      } else
        printf("%.10f\n", calc(bel[u], bel[v]));
    }
  }
  return 0;
}
