#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxN = 100005;
int parent[maxN], size[maxN], height[maxN], diameter[maxN];
vector<int> edge[maxN];
map<pair<int, int>, int> h;
set<pair<int, int> > s;
vector<int> A[maxN];
vector<long long int> sum[maxN];
int getRoot(int i) {
  if (parent[i] == i) return i;
  parent[i] = getRoot(parent[i]);
  return parent[i];
}
void join(int i, int j) {
  int ip = getRoot(i), jp = getRoot(j);
  if (ip == jp) return;
  if (size[ip] > size[jp]) {
    parent[jp] = ip;
    size[ip] += size[jp];
  } else {
    parent[ip] = jp;
    size[jp] += size[ip];
  }
}
int work(pair<int, int> p) {
  if (h.count(p)) {
    auto it = s.find(p);
    if (it != s.end()) {
      s.erase(it);
    }
    return h[p];
  }
  int a = p.first, b = p.second;
  if (edge[a].size() == 1) return h[p] = 0;
  int m = -1;
  for (auto c : edge[a])
    if (c != b) m = max(m, work(make_pair(c, a)));
  return h[p] = m + 1;
}
int main() {
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    parent[i] = i;
    size[i] = 1;
    height[i] = 0;
    diameter[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    join(a, b);
    edge[a].push_back(b);
    edge[b].push_back(a);
    s.insert(make_pair(a, b));
    s.insert(make_pair(b, a));
  }
  while (s.size()) {
    work(*s.begin());
  }
  unordered_map<int, long long int> f;
  unordered_map<int, int> D;
  for (int i = 0; i < n; i++) {
    vector<int> vs;
    for (auto j : edge[i]) vs.push_back(h[make_pair(j, i)]);
    sort(vs.begin(), vs.end());
    if (vs.size()) diameter[i] = height[i] = vs.back() + 1;
    if (vs.size() >= 2)
      diameter[i] = max(diameter[i], vs[vs.size() - 1] + vs[vs.size() - 2] + 2);
    A[getRoot(i)].push_back(height[i]);
    f[getRoot(i)] += height[i];
    D[getRoot(i)] = max(D[getRoot(i)], diameter[i]);
  }
  for (int i = 0; i < n; i++) {
    sort(A[i].begin(), A[i].end());
    if (A[i].size()) {
      sum[i].push_back(0);
      for (auto x : A[i]) sum[i].push_back(sum[i].back() + x);
    }
  }
  for (int qq = 0; qq < q; qq++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    int ap = getRoot(a);
    int bp = getRoot(b);
    if (ap == bp) {
      cout << "-1" << endl;
      continue;
    }
    if (A[ap].size() > A[bp].size()) swap(ap, bp);
    int d = max(D[ap], D[bp]);
    int i = 0;
    long long int tmpSum = 0;
    while (i < A[ap].size()) {
      auto it = lower_bound(A[bp].begin(), A[bp].end(), d - A[ap][i]);
      if (it == A[bp].begin()) break;
      int j = it - A[bp].begin();
      tmpSum += j * (long long int)d +
                (A[bp].size() - j) * ((long long int)(A[ap][i]) + 1) +
                sum[bp].back() - sum[bp][j];
      i++;
    }
    long long int an = A[ap].size() - i;
    long long int bn = A[bp].size();
    tmpSum +=
        (sum[ap].back() - sum[ap][i]) * bn + an * sum[bp].back() + an * bn;
    double tmp = tmpSum / (((double)size[ap]) * size[bp]);
    printf("%.7lf\n", tmp);
  }
  return 0;
}
