#include <bits/stdc++.h>
using namespace std;
long long h[200005], to[200005], ne[200005], en = 0, fr[200005], siz[200005],
                                             dst[200005];
vector<long long> ve, v[200005], prs[200005];
map<pair<long long, long long>, double> ans;
void add(long long a, long long b) {
  to[en] = b;
  fr[en] = a;
  ne[en] = h[a];
  h[a] = en++;
}
long long n, m, q, fa[200005], dep[200005], mx, mxl, mxr, maxx[200005];
long long gf(long long k) {
  if (fa[k] == k)
    return k;
  else
    return fa[k] = gf(fa[k]);
}
void dfs_to_que(long long o, long long fa) {
  if (dep[o] > mx) mx = dep[o], mxl = o;
  ve.push_back(o);
  for (long long i = h[o]; i >= 0; i = ne[i])
    if (to[i] != fa) {
      dep[to[i]] = dep[o] + 1;
      dfs_to_que(to[i], o);
    }
}
void dfs(long long o, long long fa) {
  if (dep[o] > mx) mx = dep[o], mxl = o;
  for (long long i = h[o]; i >= 0; i = ne[i])
    if (to[i] != fa) {
      dep[to[i]] = dep[o] + 1;
      dfs(to[i], o);
    }
}
void solve(long long o) {
  ve.clear();
  mx = -1;
  mxl = -1;
  dfs_to_que(o, 0);
  long long rt = mxl;
  mx = -1;
  mxl = -1;
  dep[rt] = 0;
  dfs(rt, 0);
  for (long long i = 0; i < (long long)ve.size(); ++i)
    maxx[ve[i]] = max(maxx[ve[i]], dep[ve[i]]);
  dep[mxl] = 0;
  dfs(mxl, 0);
  for (long long i = 0; i < (long long)ve.size(); ++i)
    maxx[ve[i]] = max(maxx[ve[i]], dep[ve[i]]);
}
double Cal(long long a, long long b) {
  double ret = 0;
  if (siz[a] > siz[b]) swap(a, b);
  long long lim = max(dst[a], dst[b]), sb = v[b].size();
  for (long long i = 0; i < (long long)v[a].size(); ++i) {
    long long l = 0, r = v[b].size() - 1;
    while (l < r) {
      long long mid = (l + r) >> 1;
      if (v[a][i] + v[b][mid] + 1 <= lim)
        l = mid + 1;
      else
        r = mid;
    }
    if (l >= 0 && l < (long long)v[b].size() && v[b][l] + v[a][i] + 1 <= lim)
      l++;
    if (l >= 0 && l < (long long)v[b].size() && v[b][l] + v[a][i] + 1 > lim)
      l--;
    if (l == (long long)v[b].size())
      ret += sb * lim;
    else if (l == -1)
      ret += prs[b][sb - 1] + v[a][i] * sb + sb;
    else {
      ret += (prs[b][sb - 1] - (l == 0 ? 0 : prs[b][l - 1])) +
             (sb - l) * (v[a][i] + 1);
      ret += l * lim;
    }
  }
  return ret;
}
signed main() {
  memset(h, -1, sizeof h);
  scanf("%I64d%I64d%I64d", &n, &m, &q);
  for (long long i = 1; i <= n; ++i) fa[i] = i;
  for (long long i = 1; i <= m; ++i) {
    long long x, y;
    scanf("%I64d%I64d", &x, &y);
    add(x, y);
    add(y, x);
    fa[gf(x)] = y;
  }
  for (long long i = 1; i <= n; ++i)
    if (gf(i) == i) solve(i);
  for (long long i = 1; i <= n; ++i)
    siz[gf(i)]++, v[gf(i)].push_back(maxx[i]),
        dst[gf(i)] = max(maxx[i], dst[gf(i)]);
  for (long long i = 1; i <= n; ++i)
    if (gf(i) == i) {
      sort(v[i].begin(), v[i].end());
      long long now = 0;
      for (long long j = 0; j < (long long)v[i].size(); ++j) {
        now += v[i][j];
        prs[i].push_back(now);
      }
    }
  for (long long i = 1; i <= q; ++i) {
    long long fl, fr, l, r;
    scanf("%I64d%I64d", &l, &r);
    fl = gf(l);
    fr = gf(r);
    if (fl == fr) {
      printf("-1\n");
      continue;
    }
    if (fl > fr) swap(fl, fr);
    if (ans[make_pair(fl, fr)])
      printf("%.10lf\n", ans[make_pair(fl, fr)] / (1.0 * siz[fl] * siz[fr]));
    else
      printf("%.10lf\n", (ans[make_pair(fl, fr)] = Cal(fl, fr)) /
                             (1.0 * siz[fl] * siz[fr]));
  }
}
