#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
inline long long read() {
  long long x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while ('0' <= c && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return x;
}
long long nxt[N << 1], head[N], go[N << 1], tot;
inline void add(long long u, long long v) {
  nxt[++tot] = head[u], head[u] = tot, go[tot] = v;
  nxt[++tot] = head[v], head[v] = tot, go[tot] = u;
}
long long n, m, q;
bool vis[N];
long long dfn[N], low[N], co[N], st[N], si[N], top, col, num;
void Tarjan(long long u) {
  st[++top] = u;
  dfn[u] = low[u] = ++num;
  for (long long i = head[u]; i; i = nxt[i]) {
    long long v = go[i];
    if (!dfn[v]) {
      Tarjan(v);
      low[u] = min(low[u], low[v]);
    } else if (!co[v])
      low[u] = min(low[u], dfn[v]);
  }
  if (dfn[u] == low[u]) {
    co[u] = ++col;
    si[col] = 1;
    while (st[top] != u) {
      co[st[top]] = col;
      si[col]++;
      --top;
    }
    --top;
  }
}
long long dis[N], all[N], coin[N], p, Max;
void dfs(long long u, long long fa) {
  if (dis[u] > Max) Max = dis[u], p = u;
  all[u] = max(all[u], dis[u]);
  for (long long i = head[u]; i; i = nxt[i]) {
    long long v = go[i];
    if (v == fa) continue;
    dis[v] = dis[u] + 1;
    dfs(v, u);
  }
}
inline void findp(long long u) {
  p = Max = -1;
  dfs(u, u);
  coin[co[u]] = max(coin[co[u]], Max);
  Max = -1;
  dis[p] = 0;
  dfs(p, p);
  coin[co[u]] = max(coin[co[u]], Max);
  Max = -1;
  dis[p] = 0;
  dfs(p, p);
  coin[co[u]] = max(coin[co[u]], Max);
}
vector<long long> belong[N], Sum[N], e[N];
map<pair<long long, long long>, double> IF;
signed main() {
  n = read(), m = read(), q = read();
  for (long long i = 1; i <= m; i++) add(read(), read());
  for (long long i = 1; i <= n; i++)
    if (!dfn[i]) Tarjan(i);
  for (long long i = 1; i <= n; i++) {
    if (!vis[co[i]]) findp(i), vis[co[i]] = 1;
    belong[co[i]].push_back(i);
  }
  for (long long i = 1; i <= col; i++) {
    for (long long j = 0; j < belong[i].size(); j++)
      e[i].push_back(all[belong[i][j]]);
    sort(e[i].begin(), e[i].end());
    for (long long j = 0; j < belong[i].size(); j++) {
      Sum[i].push_back(e[i][j]);
      if (j) Sum[i][j] += Sum[i][j - 1];
    }
  }
  long long x, y;
  while (q--) {
    x = read(), y = read();
    long long a = co[x], b = co[y];
    if (a == b) {
      printf("-1\n");
      continue;
    }
    if (IF[make_pair(a, b)] > 0) {
      printf("%.9f\n", IF[make_pair(a, b)]);
      continue;
    }
    if (si[a] > si[b]) swap(a, b);
    long long ans = 0, op = belong[a].size() * belong[b].size();
    long long MAXN = max(coin[a], coin[b]);
    for (long long i = 0; i < e[a].size(); i++) {
      long long A = e[a][i] + 1;
      long long mzx =
          upper_bound(e[b].begin(), e[b].end(), MAXN - A) - e[b].begin();
      ans += MAXN * mzx;
      if (mzx == 0)
        ans += A * e[b].size() + Sum[b][Sum[b].size() - 1];
      else
        ans += A * (e[b].size() - mzx) + Sum[b][Sum[b].size() - 1] -
               Sum[b][mzx - 1];
    }
    double res = (double)ans / op;
    IF[make_pair(b, a)] = IF[make_pair(a, b)] = res;
    printf("%.10f\n", res);
  }
}
