#include <bits/stdc++.h>
using namespace std;
const long long MOD = (1e9) + 7ll;
const int N = 100009;
struct classcomp {
  bool operator()(const int& lhs, const int& rhs) const { return lhs > rhs; }
};
int n, m, q;
int d[N], Fmax[N], lab[N], cou[N], Gmax[N], pa[N];
long long F[N];
bool vis[N];
vector<int> ed[N];
multiset<int, classcomp> s[N];
int sum[N];
map<pair<int, int>, double> check;
vector<int> vex_[N];
vector<pair<int, int> > vex[N];
int getroot(int u) {
  if (lab[u] == -1) return u;
  return lab[u] = getroot(lab[u]);
}
void Union(int a, int b) {
  if (cou[a] > cou[b]) {
    lab[b] = a;
    cou[a] += cou[b];
  } else {
    lab[a] = b;
    cou[b] += cou[a];
  }
}
void DFS(int u) {
  Fmax[u] = 0;
  for (int i = 0; i < ed[u].size(); i++) {
    int v = ed[u][i];
    if (pa[v]) continue;
    pa[v] = u;
    d[v] = d[u] + 1;
    DFS(v);
    Fmax[u] = max(Fmax[u], Fmax[v] + 1);
    s[u].insert(Fmax[v]);
  }
}
void DFS2(int u) {
  vis[u] = 1;
  Gmax[u] = 0;
  if (pa[u] == -1) {
    Gmax[u] = 0;
  } else {
    int v = pa[u];
    Gmax[u] = Gmax[v] + 1;
    multiset<int, classcomp>::iterator it = s[v].find(Fmax[u]);
    s[v].erase(it);
    if (!s[v].empty()) Gmax[u] = max(Gmax[u], *(s[v].begin()) + 2);
    s[v].insert(Fmax[u]);
  }
  sum[u] = d[u];
  if (s[u].size() >= 1) sum[u] = d[u] + *(s[u].begin()) + 1;
  if (s[u].size() >= 2) {
    multiset<int, classcomp>::iterator it = s[u].begin();
    it++;
    sum[u] = max(sum[u], *(s[u].begin()) + *it + 2);
  }
  for (int i = 0; i < ed[u].size(); i++) {
    int v = ed[u][i];
    if (pa[u] == v) continue;
    DFS2(v);
  }
}
int main() {
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    vis[i] = 0;
    lab[i] = -1;
    cou[i] = 1;
  }
  while (m--) {
    int u, v;
    scanf("%d %d", &u, &v);
    ed[u].push_back(v);
    ed[v].push_back(u);
    int a = getroot(u);
    int b = getroot(v);
    if (a == b) continue;
    Union(a, b);
  }
  for (int i = 1; i <= n; i++)
    if (lab[i] == -1) {
      d[i] = 0;
      pa[i] = -1;
      DFS(i);
      DFS2(i);
    }
  for (int i = 1; i <= n; i++) Gmax[i] = max(Gmax[i], max(d[i], Fmax[i]));
  for (int i = 1; i <= n; i++) {
    int a = getroot(i);
    vex[a].push_back(make_pair(Gmax[i], i));
    sum[a] = max(sum[a], sum[i]);
  }
  for (int i = 1; i <= n; i++)
    if (lab[i] == -1) {
      sort(vex[i].begin(), vex[i].end(), greater<pair<int, int> >());
      vex_[i].resize(vex[i].size());
      for (int j = 0; j < vex[i].size(); j++) {
        vex_[i][j] = (j == 0 ? 0 : vex_[i][j - 1]) + vex[i][j].first;
      }
    }
  while (q--) {
    int u, v;
    scanf("%d %d", &u, &v);
    int a = getroot(u);
    int b = getroot(v);
    if (a == b) {
      printf("-1\n");
    } else {
      if (cou[a] < cou[b]) {
        swap(a, b);
        swap(u, v);
      }
      if (check[make_pair(a, b)])
        printf("%0.9lf\n", check[make_pair(a, b)]);
      else {
        double ans = 0.0;
        int vmax = max(sum[a], sum[b]);
        for (int i = 0; i < vex[b].size(); i++) {
          int bound = vmax - 1 - vex[b][i].first;
          int l = 0;
          int r = vex[a].size() - 1;
          int pos;
          while (l <= r) {
            int middle = (l + r) >> 1;
            if (vex[a][middle].first >= bound) {
              pos = middle;
              l = middle + 1;
            } else
              r = middle - 1;
          }
          ans += (double)(vex_[a][pos] + pos + 1) /
                 (vex[a].size() * vex[b].size());
          ans += (double)(pos + 1) * Gmax[vex[b][i].second] /
                 (vex[a].size() * vex[b].size());
          ans += (double)vmax * (vex[a].size() - pos - 1) /
                 (vex[a].size() * vex[b].size());
        }
        printf("%0.9lf\n", ans);
        check[make_pair(a, b)] = ans;
      }
    }
  }
}
