#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
vector<int> adj[N + 1], d[N + 1];
vector<long long> sum[N + 1];
int rt[N + 1], sz[N + 1], dis[N + 1];
pair<int, int> get_farthest(int u, int p) {
  pair<int, int> ret(0, u);
  for (int i = (0), i_end = (adj[u].size()); i < i_end; ++i) {
    int v = adj[u][i];
    if (v != p) {
      pair<int, int> t = get_farthest(v, u);
      ++t.first;
      ret = max(ret, t);
    }
  }
  return ret;
}
void cal_dis(int u, int p, int d) {
  dis[u] = max(dis[u], d);
  for (int i = (0), i_end = (adj[u].size()); i < i_end; ++i) {
    int v = adj[u][i];
    if (v != p) cal_dis(v, u, d + 1);
  }
}
void dfs(int u, int p, int r) {
  rt[u] = r;
  ++sz[r];
  d[r].push_back(dis[u]);
  for (int i = (0), i_end = (adj[u].size()); i < i_end; ++i) {
    int v = adj[u][i];
    if (v != p) dfs(v, u, r);
  }
}
double query(int x, int y) {
  static map<pair<int, int>, double> M;
  if (sz[x] > sz[y]) swap(x, y);
  map<pair<int, int>, double>::iterator it = M.find(pair<int, int>(x, y));
  if (it != M.end()) return it->second;
  long long ans = 0, c = max(d[x].back(), d[y].back()) - 1;
  for (int i = (0), i_end = (d[x].size()); i < i_end; ++i) {
    long long t = d[x][i];
    int j = lower_bound(d[y].begin(), d[y].end(), c - t) - d[y].begin();
    ans += c * j + t * (d[y].size() - j) + sum[y][j];
  }
  return M[pair<int, int>(x, y)] = 1 + (long double)ans / sz[x] / sz[y];
}
int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = (0), i_end = (m); i < i_end; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = (1), i_end = (n + 1); i < i_end; ++i)
    if (!rt[i]) {
      int x = get_farthest(i, 0).second, y = get_farthest(x, 0).second;
      cal_dis(x, 0, 0);
      cal_dis(y, 0, 0);
      dfs(i, 0, i);
      sort(d[i].begin(), d[i].end());
      sum[i].resize(d[i].size() + 1);
      sum[i][d[i].size()] = 0;
      for (int j = (d[i].size() - 1), j_end = (0); j >= j_end; --j)
        sum[i][j] = d[i][j] + sum[i][j + 1];
    }
  while (q--) {
    int x, y;
    scanf("%d%d", &x, &y);
    x = rt[x];
    y = rt[y];
    if (x == y)
      puts("-1");
    else
      printf("%.9f\n", query(x, y));
  }
  return 0;
}
