#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 8;
int n, dis[maxn] = {0}, f[maxn] = {0}, z[maxn] = {0};
vector<int> v[maxn], son[maxn], str[maxn];
vector<long long> pre[maxn];
map<pair<int, int>, double> M;
pair<int, int> dfs1(int cur, int pre, int root) {
  f[cur] = root;
  pair<int, int> now = make_pair(0, cur);
  for (auto to : v[cur]) {
    if (to == pre) continue;
    pair<int, int> tmp = dfs1(to, cur, root);
    if (tmp.first + 1 > now.first) now = make_pair(tmp.first + 1, tmp.second);
  }
  return now;
}
void dfs2(int cur, int pre, int d) {
  dis[cur] = max(dis[cur], d);
  for (auto to : v[cur]) {
    if (to == pre) continue;
    dfs2(to, cur, d + 1);
  }
}
void init() {
  for (int i = 1; i <= n; ++i) {
    if (f[i] == 0) {
      pair<int, int> a = dfs1(i, 0, i);
      pair<int, int> b = dfs1(a.second, 0, i);
      dfs2(a.second, 0, 0), dfs2(b.second, 0, 0);
      z[i] = b.first;
    }
  }
  for (int i = 1; i <= n; ++i) son[f[i]].push_back(i);
  for (int i = 1; i <= n; ++i) {
    if (son[i].size()) {
      for (auto j : son[i]) str[i].push_back(dis[j]);
      sort(str[i].begin(), str[i].end());
      pre[i].push_back((long long)str[i][0]);
      for (int j = 1; j < str[i].size(); ++j)
        pre[i].push_back(pre[i][j - 1] + (long long)str[i][j]);
    }
  }
}
double cal(int a, int b) {
  if (M.count(make_pair(a, b))) return M[make_pair(a, b)];
  double tmp = 0;
  for (auto i : str[a]) {
    int pos =
        upper_bound(str[b].begin(), str[b].end(), max(z[a], z[b]) - i - 1) -
        str[b].begin();
    if (pos == str[b].size())
      tmp += max(z[a], z[b]) * 1.0 * son[b].size();
    else
      tmp += max(z[a], z[b]) * 1.0 * pos +
             (i + 1) * 1.0 * (son[b].size() - pos) + pre[b].back() -
             (pos == 0 ? 0 : pre[b][pos - 1]);
  }
  tmp /= (son[a].size() * 1.0 * son[b].size());
  M[make_pair(a, b)] = tmp;
  return tmp;
}
int main() {
  int m, q;
  scanf("%d%d%d", &n, &m, &q);
  while (m--) {
    int a, b;
    scanf("%d%d", &a, &b);
    v[a].push_back(b), v[b].push_back(a);
  }
  init();
  while (q--) {
    int a, b;
    scanf("%d%d", &a, &b);
    if (f[a] == f[b]) {
      puts("-1");
      continue;
    }
    if (son[f[a]].size() > son[f[b]].size()) swap(a, b);
    printf("%.10f\n", cal(f[a], f[b]));
  }
  return 0;
}
