#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e5;
int n, m, Q, sn;
vector<int> len[Maxn + 5];
vector<double> sum[Maxn + 5];
int dia[Maxn + 5], siz[Maxn + 5];
map<pair<int, int>, double> ans;
bool vis[Maxn + 5];
struct Edge {
  int v, nxt;
  Edge() {}
  Edge(int v0, int n0) {
    v = v0;
    nxt = n0;
  }
};
Edge e[Maxn * 2 + 5];
int head[Maxn + 5];
int nume;
inline void addEdge(int u, int v) {
  e[++nume] = Edge(v, head[u]);
  head[u] = nume;
  e[++nume] = Edge(u, head[v]);
  head[v] = nume;
}
int fa[Maxn + 5];
inline void initFather() {
  for (int i = 0; i <= Maxn; i++) fa[i] = i;
}
int getFather(int x) { return fa[x] = (fa[x] == x ? x : getFather(fa[x])); }
inline bool mergeFather(int x, int y) {
  int fx = getFather(x), fy = getFather(y);
  if (fx == fy) return false;
  if (fx < fy)
    fa[fx] = fy;
  else
    fa[fy] = fx;
  return true;
}
int dp[Maxn + 5][2], fdp[Maxn + 5];
void dfs(int x, int from) {
  vis[x] = true;
  fdp[x] = dp[x][0] = dp[x][1] = 0;
  siz[getFather(x)]++;
  for (int i = head[x]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == from) continue;
    dfs(v, x);
  }
  for (int i = head[x]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == from) continue;
    if (dp[v][0] + 1 > dp[x][0]) {
      dp[x][1] = dp[x][0];
      dp[x][0] = dp[v][0] + 1;
    } else if (dp[v][0] + 1 > dp[x][1])
      dp[x][1] = dp[v][0] + 1;
  }
}
void dfs2(int x, int from) {
  int maxLen = dp[x][0], maxDia = dp[x][0] + dp[x][1];
  if (from != 0) {
    fdp[x] = fdp[from] + 1;
    if (dp[from][0] == dp[x][0] + 1)
      fdp[x] = max(fdp[x], dp[from][1] + 1);
    else
      fdp[x] = max(fdp[x], dp[from][0] + 1);
    maxLen = max(maxLen, fdp[x]);
    maxDia = max(maxDia, dp[x][0] + fdp[x]);
  }
  dia[getFather(x)] = max(dia[getFather(x)], maxDia);
  len[getFather(x)].push_back(maxLen);
  for (int i = head[x]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == from) continue;
    dfs2(v, x);
  }
}
inline double solve(int x, int y) {
  double ret = 0;
  if (siz[x] >= sn && siz[y] >= sn && ans[make_pair(x, y)] != 0)
    return ans[make_pair(x, y)];
  int maxDia = max(dia[x], dia[y]);
  int lim = siz[x];
  for (int i = 0; i < lim; i++) {
    int req = maxDia - 1 - len[x][i];
    int pos = upper_bound(len[y].begin(), len[y].end(), req) - len[y].begin();
    double rate = 0;
    rate += (double)pos * maxDia;
    if (pos <= siz[y]) {
      if (pos == 0)
        rate += sum[y][siz[y] - 1] + (double)siz[y] * (1 + len[x][i]);
      else
        rate += sum[y][siz[y] - 1] - sum[y][pos - 1] +
                (double)(siz[y] - pos) * (1 + len[x][i]);
    }
    ret += rate;
  }
  ret = ret / (double)siz[x] / (double)siz[y];
  if (siz[x] >= sn && siz[y] >= sn) ans[make_pair(x, y)] = ret;
  return ret;
}
int main() {
  initFather();
  scanf("%d%d%d", &n, &m, &Q);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    addEdge(x, y);
    mergeFather(x, y);
  }
  memset(vis, false, sizeof(vis));
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      dfs(i, 0);
      dfs2(i, 0);
      int fx = getFather(i);
      double rate = 0;
      ;
      sort(len[fx].begin(), len[fx].end());
      for (int j = 0; j < siz[fx]; j++)
        sum[fx].push_back(rate = rate + (double)len[fx][j]);
    }
  sn = sqrt(n);
  for (int i = 1; i <= Q; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    int fu = getFather(u), fv = getFather(v);
    if (siz[fu] > siz[fv] || (siz[fu] == siz[fv] && fu > fv)) swap(fu, fv);
    if (fu == fv)
      printf("-1\n");
    else
      printf("%.10f\n", solve(fu, fv));
  }
  return 0;
}
