#include <bits/stdc++.h>
using namespace std;
long long int Pow(long long int a, long long int b, long long int md,
                  long long int ans = 1) {
  for (; b; b >>= 1, a = a * a % md)
    if (b & 1) ans = ans * a % md;
  return ans % md;
}
const long long int MAXN = 1e5 + 10;
const long long int INF = 8e18;
const long long int MOD = 1e9 + 7;
vector<long long int> adj[MAXN], comp[MAXN], vec[MAXN], ps[MAXN];
long long int mx[MAXN], mark[MAXN], dist[2][MAXN], H[MAXN], SZ[MAXN], c[MAXN],
    D[2][MAXN], n, m, q, timer = 0;
map<pair<long long int, long long int>, double> mp;
void DFS(long long int v) {
  comp[timer].push_back(v);
  c[v] = timer;
  SZ[timer]++;
  mark[v] = 1;
  for (long long int u : adj[v]) {
    if (mark[u] == 0) {
      DFS(u);
    }
  }
}
void SFD(long long int v, long long int p = -1) {
  for (long long int u : adj[v]) {
    if (u != p) {
      H[u] = H[v] + 1;
      SFD(u, v);
    }
  }
}
int main() {
  scanf("%lld%lld%lld", &n, &m, &q);
  for (long long int i = 1; i <= m; i++) {
    long long int u, v;
    scanf("%lld%lld", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (long long int i = 1; i <= n; i++) {
    if (mark[i] == 0) {
      timer++;
      DFS(i);
    }
  }
  for (long long int i = 1; i <= timer; i++) {
    H[comp[i][0]] = 0;
    SFD(comp[i][0]);
    for (long long int u : comp[i]) {
      if (H[u] >= H[D[0][i]]) D[0][i] = u;
    }
    H[D[0][i]] = 0;
    SFD(D[0][i]);
    for (long long int u : comp[i]) {
      if (H[u] >= H[D[1][i]]) D[1][i] = u;
    }
    for (long long int u : comp[i]) {
      dist[0][u] = H[u];
    }
    H[D[1][i]] = 0;
    SFD(D[1][i]);
    for (long long int u : comp[i]) {
      dist[1][u] = H[u];
      mx[u] = max(dist[1][u], dist[0][u]);
      vec[i].push_back(mx[u]);
    }
    sort((vec[i]).begin(), (vec[i]).end());
    ps[i].push_back(0);
    for (long long int x : vec[i]) ps[i].push_back(ps[i].back() + x);
  }
  while (q--) {
    long long int u, v;
    scanf("%lld%lld", &u, &v);
    double ans = 0.0;
    v = c[v], u = c[u];
    if (SZ[u] > SZ[v]) swap(u, v);
    long long int x = max(vec[u].back(), vec[v].back());
    if (u == v) {
      printf("-1\n");
      continue;
    }
    if (mp.find({u, v}) != mp.end()) {
      printf("%.10f\n", mp[{u, v}]);
      continue;
    }
    for (long long int w : comp[u]) {
      long long int y =
          lower_bound((vec[v]).begin(), (vec[v]).end(), x - mx[w]) -
          vec[v].begin();
      ans += 1.0 * x * y + (ps[v].back() - ps[v][y]) +
             ((long long int)vec[v].size() - y) * (mx[w] + 1);
    }
    printf("%.10f\n", mp[{u, v}] = mp[{v, u}] = (ans / (1.0 * SZ[u] * SZ[v])));
  }
  return 0;
}
