#include <bits/stdc++.h>
using namespace std;
struct edge {
  int nxt, t;
} e[100010 << 1];
int head[100010], edge_cnt;
void add_edge(int x, int y) {
  e[edge_cnt] = (edge){head[x], y};
  head[x] = edge_cnt++;
}
bool vis[100010];
int A[100010], h, Rt, Rt1, Mx, dis[100010], fa[100010];
void dfs0(int x, int f, int l) {
  if (l > Mx) {
    Mx = l;
    Rt = x;
  }
  A[++h] = x;
  int i;
  for (i = head[x]; ~i; i = e[i].nxt) {
    int to = e[i].t;
    if (to == f) {
      continue;
    }
    dfs0(to, x, l + 1);
  }
}
void dfs1(int x, int f, int l) {
  fa[x] = f;
  if (l > Mx) {
    Mx = l;
    Rt1 = x;
  }
  int i;
  for (i = head[x]; ~i; i = e[i].nxt) {
    int to = e[i].t;
    if (to == f) {
      continue;
    }
    dfs1(to, x, l + 1);
  }
}
void dfs2(int x) {
  if (vis[x]) {
    return;
  }
  dfs2(fa[x]);
  vis[x] = 1;
  dis[x] = dis[fa[x]] + 1;
}
int st[100010], ed[100010], B[100010], bel[100010], siz[100010], d[100010];
long long sum[100010];
map<pair<int, int>, double> mp;
int main() {
  memset(head, -1, sizeof(head));
  int n, m, q, i, j;
  scanf("%d%d%d", &n, &m, &q);
  for (i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add_edge(x, y);
    add_edge(y, x);
  }
  int tot = 0, Blk_cnt = 0;
  for (i = 1; i <= n; i++) {
    if (vis[i]) {
      continue;
    }
    h = 0;
    Mx = -1;
    dfs0(i, 0, 0);
    Mx = -1;
    dfs1(Rt, 0, 0);
    int now = Rt1, cnt = 0;
    while (now != Rt) {
      vis[now] = 1;
      dis[now] = max(cnt, Mx - cnt);
      now = fa[now];
      cnt++;
    }
    vis[Rt] = 1;
    dis[Rt] = Mx;
    st[++Blk_cnt] = tot + 1;
    for (j = 1; j <= h; j++) {
      bel[A[j]] = Blk_cnt;
      dfs2(A[j]);
      B[++tot] = dis[A[j]];
    }
    ed[Blk_cnt] = tot;
    siz[Blk_cnt] = h;
    d[Blk_cnt] = Mx;
    sort(B + st[Blk_cnt], B + ed[Blk_cnt] + 1, greater<int>());
    for (j = st[Blk_cnt]; j <= ed[Blk_cnt]; j++) {
      if (j > st[Blk_cnt]) {
        sum[j] = sum[j - 1];
      }
      sum[j] += B[j];
    }
  }
  for (i = 1; i <= q; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    int a = bel[x], b = bel[y];
    if (a == b) {
      printf("-1\n");
      continue;
    }
    if (siz[a] > siz[b]) {
      swap(a, b);
    }
    if (mp.find(make_pair(a, b)) != mp.end()) {
      printf("%.6f\n", mp[make_pair(a, b)]);
      continue;
    }
    int mx = max(d[a], d[b]);
    int R = ed[b];
    long long Cnt = 0, Ans = 0, all = 1LL * siz[a] * siz[b];
    for (j = st[a]; j <= ed[a] && R >= st[b] && B[j] + B[st[b]] + 1 > mx; j++) {
      int l = st[b], r = R;
      R = st[b] - 1;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (B[j] + B[mid] + 1 > mx) {
          R = mid;
          l = mid + 1;
        } else {
          r = mid - 1;
        }
      }
      int t = R - st[b] + 1;
      Cnt += t;
      Ans += 1LL * t * (B[j] + 1) + sum[R];
    }
    Ans += (all - Cnt) * mx;
    double Ans1 = 1.0 * Ans / all;
    printf("%.6f\n", Ans1);
    mp[make_pair(a, b)] = Ans1;
  }
  return 0;
}
