#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
vector<int> adj[maxn];
vector<int> mem[maxn];
vector<long long> pre[maxn];
int n, tt, m, q;
int bel[maxn], g[maxn], gs[maxn], f[maxn], p[maxn];
inline int gval(int u, int v) {
  if (gs[u] != v) return g[u];
  return f[u];
}
int a[maxn], b[maxn];
int cres;
inline void dfs0(int u, int fa, int curc) {
  bel[u] = curc;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    dfs0(v, u, curc);
    int tp = g[v] + 1;
    if (tp > g[u]) {
      g[u] = tp;
      gs[u] = v;
    }
  }
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa || v == gs[u]) continue;
    int tp = g[v] + 1;
    if (tp > f[u]) {
      f[u] = tp;
    }
  }
  cres = max(cres, g[u] + f[u]);
}
inline void dfs1(int u, int fa) {
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    p[v] = p[u] + 1;
    p[v] = max(p[v], gval(u, v) + 1);
    dfs1(v, u);
  }
  cres = max(cres, g[u] + p[u]);
}
inline void init() {
  for (int i = 1; i <= n; i++) {
    if (bel[i] == 0) {
      cres = 0;
      tt++;
      dfs0(i, i, tt);
      dfs1(i, i);
      b[tt] = cres;
    }
  }
  for (int i = 1; i <= n; i++) {
    a[i] = max(g[i], p[i]);
    mem[bel[i]].push_back(a[i]);
  }
  for (int i = 1; i <= tt; i++) {
    sort(mem[i].begin(), mem[i].end());
    reverse(mem[i].begin(), mem[i].end());
    for (int j = 0; j < mem[i].size(); j++) {
      long long tp = mem[i][j];
      if (j != 0) tp += pre[i][j - 1];
      pre[i].push_back(tp);
    }
  }
}
map<int, double> mp[maxn];
inline void work(int u, int v) {
  if (bel[u] == bel[v]) {
    printf("-1\n");
    return;
  }
  u = bel[u], v = bel[v];
  if (mem[u].size() < mem[v].size()) swap(u, v);
  if (mp[u].count(v)) {
    double tp = mp[u][v];
    printf("%.8f\n", tp);
    return;
  }
  double res = 0;
  long long tmx = max(b[u], b[v]);
  for (int i = 0; i < mem[v].size(); i++) {
    long long tp = mem[v][i];
    int l = 0, r = (int)mem[u].size() - 1, ans = -1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if ((mem[u][mid] + tp) >= tmx) {
        ans = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    if (ans != -1) res += pre[u][ans];
    res += 1ll * (ans + 1) * (tp + 1);
    res += 1ll * tmx * ((int)mem[u].size() - 1 - ans);
  }
  double tsz1 = mem[u].size(), tsz2 = mem[v].size();
  res /= tsz1;
  res /= tsz2;
  printf("%.8f\n", res);
  mp[u][v] = mp[v][u] = res;
  return;
}
int main() {
  cin >> n >> m >> q;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  init();
  while (q--) {
    int u, v;
    scanf("%d%d", &u, &v);
    work(u, v);
  }
  return 0;
}
