#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int oo = 0x3f3f3f3f;
long long f[MAXN][2], g[MAXN], N, M, Q, root[MAXN], trees = 0, nxt[MAXN][2],
                                                    mx[MAXN], bt[MAXN];
vector<long long> dis[MAXN], pre[MAXN];
map<pair<int, int>, double> ans;
namespace Graph {
struct edge {
  int y, next;
} e[MAXN << 1];
int LINK[MAXN], len = 0;
inline void insert(int x, int y) {
  e[++len].next = LINK[x];
  LINK[x] = len;
  e[len].y = y;
}
inline void Insert(int x, int y) {
  insert(x, y);
  insert(y, x);
}
void DP(int node, int fa) {
  bt[node] = trees;
  nxt[node][0] = nxt[node][1] = 0;
  for (int i = LINK[node]; i; i = e[i].next)
    if (e[i].y != fa) {
      DP(e[i].y, node);
      if (f[e[i].y][0] + 1 >= f[node][0]) {
        f[node][1] = f[node][0];
        nxt[node][1] = nxt[node][0];
        f[node][0] = f[e[i].y][0] + 1;
        nxt[node][0] = e[i].y;
      } else if (f[e[i].y][0] + 1 >= f[node][1]) {
        f[node][1] = f[e[i].y][0] + 1;
        nxt[node][1] = e[i].y;
      }
    }
}
void DFS(int node, int fa) {
  for (int i = LINK[node]; i; i = e[i].next)
    if (e[i].y != fa) {
      g[e[i].y] = max(g[e[i].y], g[node] + 1);
      if (e[i].y != nxt[node][0])
        g[e[i].y] = max(g[e[i].y], f[node][0] + 1);
      else
        g[e[i].y] = max(g[e[i].y], f[node][1] + 1);
      DFS(e[i].y, node);
    }
}
}  // namespace Graph
using namespace Graph;
namespace solution {
void Prepare() {
  scanf("%lld%lld%lld", &N, &M, &Q);
  for (int i = 1; i <= M; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    Insert(x, y);
  }
  for (int i = 1; i <= N; i++)
    if (!bt[i]) {
      trees++;
      root[trees] = i;
      DP(i, 0);
    }
  for (int i = 1; i <= trees; i++) DFS(root[i], 0);
  for (int i = 1; i <= N; i++) {
    mx[i] = max(g[i], f[i][0]);
    dis[bt[i]].push_back(mx[i]);
  }
  for (int i = 1; i <= trees; i++) sort(dis[i].begin(), dis[i].end());
  for (int i = 1; i <= trees; i++) {
    long long sum = 0, siz = dis[i].size();
    for (int j = 0; j <= siz - 1; j++) {
      sum += dis[i][j];
      pre[i].push_back(sum);
    }
  }
}
void Solve() {
  while (Q--) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    x = bt[x];
    y = bt[y];
    if (x == y) {
      puts("-1");
      continue;
    }
    if (dis[x].size() > dis[y].size()) swap(x, y);
    if (ans[make_pair(x, y)]) {
      printf("%.10lf\n", ans[make_pair(x, y)]);
      continue;
    }
    long long Max = max(dis[x].back(), dis[y].back()), sum = 0,
              siz1 = dis[x].size(), siz2 = dis[y].size();
    sum = siz1 * pre[y].back() + siz2 * pre[x].back() + siz1 * siz2;
    for (int i = 0; i <= siz1 - 1; i++) {
      long long leftt = 0, rightt = siz2 - 1, mid, len = dis[x][i], rnk = -1;
      while (leftt + 1 < rightt) {
        mid = (leftt + rightt) >> 1;
        if (len + dis[y][mid] + 1 < Max)
          leftt = mid;
        else
          rightt = mid;
      }
      for (int j = leftt; j <= rightt; j++)
        if (len + dis[y][j] + 1 < Max) rnk = j;
      if (rnk == -1) break;
      sum -= (len + 1) * (rnk + 1) + pre[y][rnk];
      sum += Max * (rnk + 1);
    }
    ans[make_pair(x, y)] = (double)sum / (double)(siz1 * siz2);
    printf("%.10lf\n", ans[make_pair(x, y)]);
  }
}
}  // namespace solution
int main() {
  using namespace solution;
  Prepare();
  Solve();
  return 0;
}
