#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
vector<int> dist, mycc;
vector<int> visited;
struct CC {
  vector<long long> dists;
  vector<long long> dists_sum;
  int sz, diameter, id;
  explicit CC(int u, int id_) {
    id = id_;
    dists.clear();
    dfs_cc(u, -1);
    sort(dists.begin(), dists.end());
    sz = dists.size();
    diameter = dists.back();
    dists_sum = vector<long long>(sz, 0);
    dists_sum[sz - 1] = dists[sz - 1];
    for (int i = sz - 2; i >= 0; --i) {
      dists_sum[i] = dists[i] + dists_sum[i + 1];
    }
  }
  void dfs_cc(int u, int par) {
    visited[u] = 1;
    mycc[u] = id;
    dists.push_back(dist[u]);
    for (int v : g[u]) {
      if (v != par) dfs_cc(v, u);
    }
  }
  double solve_and_print_query(CC& cc) {
    if (id == cc.id) {
      return -1.0;
    }
    if (cc.sz < sz) {
      return cc.solve_and_print_query(*this);
    }
    long long sol = 0;
    long long big_diam = max(diameter, cc.diameter);
    for (int i = 0; i < sz; ++i) {
      int j = lower_bound(cc.dists.begin(), cc.dists.end(),
                          big_diam - dists[i] - 1) -
              cc.dists.begin();
      if (j < cc.sz)
        sol += cc.dists_sum[j] + (dists[i] + 1) * (long long)(cc.sz - j);
      if (j > 0) sol += j * big_diam;
    }
    return (double)sol / ((double)sz * (double)cc.sz);
  }
};
pair<int, int> dfs_find_farthest(int u, int par) {
  pair<int, int> ans(0, u);
  for (int v : g[u]) {
    if (v != par) {
      pair<int, int> tmp = dfs_find_farthest(v, u);
      ++tmp.first;
      ans = max(ans, tmp);
    }
  }
  return ans;
}
void dfs_fill_dist(int u, int par, int d) {
  visited[u] = 1;
  dist[u] = max(dist[u], d);
  for (int v : g[u]) {
    if (v != par) dfs_fill_dist(v, u, d + 1);
  }
}
void find_dist(int root) {
  int x = dfs_find_farthest(root, -1).second;
  pair<int, int> diameter_and_y = dfs_find_farthest(x, -1);
  dfs_fill_dist(x, -1, 0);
  dfs_fill_dist(diameter_and_y.second, -1, 0);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  int n, m, q;
  cin >> n >> m >> q;
  g = vector<vector<int> >(n);
  for (int i = 0, u, v; i < m; ++i) {
    cin >> u >> v;
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dist = mycc = visited = vector<int>(n, 0);
  for (int i = 0; i < n; ++i) {
    if (!visited[i]) find_dist(i);
  }
  visited = vector<int>(n, 0);
  vector<CC> ccs;
  int next_cc_id = 0;
  for (int i = 0; i < n; ++i) {
    if (!visited[i]) {
      ccs.emplace_back(i, next_cc_id++);
    }
  }
  vector<double> sols;
  map<pair<int, int>, double> mapsol;
  for (int qq = 0, u, v; qq < q; ++qq) {
    cin >> u >> v;
    --u;
    --v;
    int ucc = mycc[u];
    int vcc = mycc[v];
    if (ucc > vcc) swap(ucc, vcc);
    if (mapsol.count(pair<int, int>(ucc, vcc)) == 0)
      mapsol[pair<int, int>(ucc, vcc)] =
          (ccs[ucc].solve_and_print_query((ccs[vcc])));
    sols.push_back(mapsol[pair<int, int>(ucc, vcc)]);
  }
  for (int i = 0; i < q; ++i) {
    if (sols[i] < 0.5)
      cout << "-1\n";
    else
      cout << sols[i] << '\n';
  }
}
