#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, m, q;
int const N = 1e5 + 2;
int const SQ = 330;
vector<int> D[N];
pair<int, int> query[N];
bool visited[N];
int comp[N];
int low[N];
map<pair<int, int>, int> rememb;
pair<int, int> low2[N];
int high[N];
int furt[N];
int diam[N];
int amcomp = 1;
int sizt[N];
vector<int> sof[N];
vector<ll> pre[N];
double ans[N];
void dfs(int a, int pre) {
  visited[a] = true;
  comp[a] = amcomp;
  sizt[amcomp]++;
  low2[a] = {-1, -1};
  for (int i = 0; i < D[a].size(); i++) {
    int u = D[a][i];
    if (u == pre) continue;
    dfs(u, a);
    low[a] = max(low[a], low[u] + 1);
    if (low[u] < low2[a].second)
      continue;
    else
      low2[a] = (low2[a].first > low[u])
                    ? pair<int, int>{low2[a].first, low[u]}
                    : pair<int, int>{low[u], low2[a].first};
  }
}
void dfs_high(int a, int pre) {
  for (int i = 0; i < D[a].size(); i++) {
    int u = D[a][i];
    if (u == pre) continue;
    if (low[u] == low2[a].first)
      high[u] = max(high[a] + 1, low2[a].second + 2);
    else
      high[u] = max(high[a] + 1, low2[a].first + 2);
    furt[u] = max(low[u], high[u]);
    sof[amcomp].push_back(furt[u]);
    diam[amcomp] = max(diam[amcomp], furt[u]);
    dfs_high(u, a);
  }
}
int find_earliest(int l, int r, vector<int>& us, int val) {
  if (l == r) return l;
  int mid = (l + r) >> 1;
  if (us[mid] >= val)
    return find_earliest(l, mid, us, val);
  else
    return find_earliest(mid + 1, r, us, val);
}
double answer_query(int c) {
  int r1 = comp[query[c].first];
  int r2 = comp[query[c].second];
  if (r1 == r2) {
    return -1;
  } else {
    int ruru = max(diam[r1], diam[r2]);
    ll koniec = 0;
    if (sizt[r1] > sizt[r2]) swap(r1, r2);
    if (sizt[r1] >= SQ) {
      if (rememb.find({r1, r2}) != rememb.end()) {
        return ans[rememb[{r1, r2}]];
      }
      rememb[{r1, r2}] = c;
    }
    for (int i = 0; i < sof[r1].size(); i++) {
      int qw = find_earliest(0, sof[r2].size(), sof[r2], ruru - 1 - sof[r1][i]);
      koniec += (ll)(pre[r2][sof[r2].size()] - pre[r2][qw]);
      koniec += (ll)(sof[r2].size() - qw) * (ll)(sof[r1][i] + 1);
      koniec += (ll)qw * (ll)ruru;
    }
    return ans[c] = (double)koniec / (double)((ll)sizt[r1] * (ll)sizt[r2]);
  }
}
int main() {
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    D[a].push_back(b);
    D[b].push_back(a);
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d %d", &query[i].first, &query[i].second);
  }
  for (int i = 1; i <= n; i++) {
    if (!visited[i]) {
      dfs(i, 0);
      furt[i] = low[i];
      diam[amcomp] = furt[i];
      sof[amcomp].push_back(furt[i]);
      dfs_high(i, 0);
      sort(sof[amcomp].begin(), sof[amcomp].end());
      pre[amcomp].push_back(0);
      for (int j = 1; j <= sof[amcomp].size(); j++) {
        pre[amcomp].push_back((ll)sof[amcomp][j - 1] + pre[amcomp][j - 1]);
      }
      amcomp++;
    }
  }
  for (int i = 1; i <= q; i++) {
    printf("%.10f \n", answer_query(i));
  }
  return 0;
}
