#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 77;
int n, m, q, cur = 1, b;
int Mxd[N], Mxtot[N], d[N], C[N];
vector<int> a[N], V[N];
vector<long long> P[N];
map<pair<int, int>, long double> Sv;
void dfs(int v, int prev = -1) {
  if (d[v] > Mxd[v]) Mxd[v] = d[v];
  C[v] = cur;
  if (d[v] >= d[b]) b = v;
  for (int u : a[v])
    if (u != prev) d[u] = d[v] + 1, dfs(u, v);
}
inline void Solve(int v, int u) {
  if (int(V[v].size()) > int(V[u].size())) swap(v, u);
  if (v == u) {
    cout << "-1\n";
    return;
  }
  if (Sv[make_pair(v, u)] != 0) {
    cout << fixed << setprecision(10) << Sv[make_pair(v, u)] << '\n';
    return;
  }
  long long A = 0;
  int sz = V[v].size();
  int h = max(Mxtot[v], Mxtot[u]);
  for (int i = 0; i < sz; ++i) {
    int id = lower_bound(V[u].begin(), V[u].end(), h - V[v][i]) - V[u].begin();
    A += id * 1ll * h + P[u].back() - (id == 0 ? 0 : P[u][id - 1]) +
         (V[v][i] + 1) * 1ll * (int(V[u].size()) - id);
  }
  long double t = (long double)A / (long double)int(V[v].size()) /
                  (long double)int(V[u].size());
  Sv[make_pair(v, u)] = t;
  Solve(v, u);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> q;
  for (int v, u, i = 1; i <= m; ++i) {
    cin >> v >> u;
    a[v].push_back(u);
    a[u].push_back(v);
  }
  for (int i = 1; i <= n; ++i) {
    if (C[i]) continue;
    b = 0;
    dfs(i);
    int t = b;
    b = 0;
    d[t] = 0, dfs(t);
    d[b] = 0, dfs(b);
    ++cur;
  }
  for (int i = 1; i <= n; ++i) V[C[i]].push_back(Mxd[i]);
  for (int i = 1; i < cur; ++i) {
    sort(V[i].begin(), V[i].end());
    Mxtot[i] = V[i].back();
    long long tot = 0;
    for (int x : V[i]) tot += x, P[i].push_back(tot);
  }
  while (q--) {
    int v, u;
    cin >> v >> u;
    Solve(C[u], C[v]);
  }
  return 0;
}
