#include <bits/stdc++.h>
using namespace std;
int d[100005], sz[100005], bel[100005], head[100005], nxt[200005], v[200005],
    tot = 0;
bool vis[100005];
int ch[100005], fa[100005], mx[100005], mn[100005], cnt = 0, n, m, q;
vector<double> f[100005];
vector<double> t[100005];
map<int, double> mp[100005];
inline int read() {
  int x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x;
}
inline void add(int a, int b) {
  tot++;
  nxt[tot] = head[a];
  head[a] = tot;
  v[tot] = b;
}
void dfs1(int pos, int pa) {
  vis[pos] = 1;
  sz[cnt]++;
  bel[pos] = cnt;
  for (int i = head[pos]; i; i = nxt[i]) {
    if (v[i] != pa) {
      fa[v[i]] = pos;
      dfs1(v[i], pos);
      if (mx[v[i]] + 1 > mx[pos]) {
        mn[pos] = mx[pos];
        ch[pos] = v[i];
        mx[pos] = mx[v[i]] + 1;
      } else {
        if (mx[v[i]] + 1 > mn[pos]) {
          mn[pos] = mx[v[i]] + 1;
        }
      }
    }
  }
}
void dfs2(int pos) {
  if (fa[pos]) {
    int pt;
    if (ch[fa[pos]] == pos) {
      pt = mn[fa[pos]];
    } else {
      pt = mx[fa[pos]];
    }
    if (pt + 1 > mx[pos]) {
      mn[pos] = mx[pos];
      ch[pos] = -1;
      mx[pos] = pt + 1;
    } else {
      if (pt + 1 > mn[pos]) {
        mn[pos] = pt + 1;
      }
    }
  }
  for (int i = head[pos]; i; i = nxt[i]) {
    if (v[i] != fa[pos]) {
      dfs2(v[i]);
    }
  }
  f[cnt].push_back(((double)(mx[pos])));
  d[cnt] = max(d[cnt], mx[pos] + mn[pos]);
}
int main() {
  int i, j, u, v, x, y;
  n = read();
  m = read();
  q = read();
  for (i = 1; i <= m; i++) {
    u = read();
    v = read();
    add(u, v);
    add(v, u);
  }
  for (i = 1; i <= n; i++) {
    if (!vis[i]) {
      cnt++;
      dfs1(i, 0);
      dfs2(i);
      sort(f[cnt].begin(), f[cnt].end());
      double pt = 0.0;
      for (j = 0; j < sz[cnt]; j++) {
        pt += f[cnt][j];
        t[cnt].push_back(pt);
      }
    }
  }
  while (q--) {
    x = read();
    y = read();
    if (bel[x] == bel[y]) {
      puts("-1");
      continue;
    }
    x = bel[x];
    y = bel[y];
    if (sz[x] > sz[y]) {
      int t = x;
      x = y;
      y = t;
    }
    if (mp[x].find(y) != mp[x].end()) {
      printf("%.12lf\n", mp[x][y]);
      continue;
    }
    double ans = 0.0;
    double p = ((double)(d[x]));
    if (((double)(d[y])) > p) {
      p = ((double)(d[y]));
    }
    for (i = 0; i < sz[x]; i++) {
      int l = 0, r = sz[y] - 1;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (f[y][mid] + f[x][i] + 1.0 < p) {
          l = mid + 1;
        } else {
          r = mid - 1;
        }
      }
      if (r < 0) {
        ans +=
            t[y][sz[y] - 1] + ((double)(sz[y])) * f[x][i] + ((double)(sz[y]));
        continue;
      }
      ans += (t[y][sz[y] - 1] - t[y][r]) + ((double)(sz[y] - r - 1)) +
             ((double)(sz[y] - 1 - r)) * f[x][i];
      ans += p * ((double)(r + 1));
    }
    ans /= (((double)(sz[x])) * ((double)(sz[y])));
    printf("%.12lf\n", ans);
    mp[x][y] = ans;
  }
  return 0;
}
