#include <bits/stdc++.h>
using namespace std;
vector<long long int> adj[100005], d[100005];
vector<long long int> sum[100005];
long long int hasComp[100005], dist[100005], sz[100005];
long long int n, m, q, u, v;
pair<int, int> x;
long long int getfar(long long int i, long long int mark) {
  queue<pair<int, int> > q;
  q.push({i, 0});
  while (!q.empty()) {
    x = q.front();
    q.pop();
    if (mark == 0) hasComp[x.first] = i;
    for (long long int j : adj[x.first])
      if (j != x.second) q.push({j, x.first});
  }
  return x.first;
}
void set_distances(long long int u, long long int p, long long int d) {
  dist[u] = max(dist[u], d);
  for (long long int i : adj[u]) {
    if (i != p) set_distances(i, u, d + 1);
  }
}
void dfs_collect(long long int u, long long int p, long long int cmp) {
  sz[cmp]++;
  d[cmp].push_back(dist[u]);
  for (long long int v : adj[u]) {
    if (v != p) dfs_collect(v, u, cmp);
  }
}
map<pair<int, int>, double> ans;
double query(long long int x, long long int y) {
  if (ans.find({x, y}) != ans.end()) return ans[{x, y}];
  double Ans = 0;
  if (sz[x] > sz[y]) swap(x, y);
  long long int diam = max(d[x].back(), d[y].back());
  for (long long int i = 0; i < d[x].size(); i++) {
    long long int left = d[x][i];
    long long int j =
        lower_bound(d[y].begin(), d[y].end(), diam - left) - d[y].begin();
    Ans += j * diam + (d[y].size() * 1LL - j) * (left + 1) + sum[y][j];
  }
  Ans = Ans / (sz[x] * sz[y] * 1.0);
  return ans[{x, y}] = ans[{y, x}] = Ans;
}
int main() {
  scanf("%lld %lld %lld", &n, &m, &q);
  for (long long int i = 0; i < m; i++) {
    scanf("%lld %lld", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (long long int i = 1; i <= n; i++) {
    if (hasComp[i] == 0) {
      long long int x = getfar(i, 0);
      long long int y = getfar(x, 1);
      set_distances(x, 0, 0);
      set_distances(y, 0, 0);
      dfs_collect(i, 0, i);
      sort(d[i].begin(), d[i].end());
      sum[i].resize(d[i].size() + 1);
      sum[i][d[i].size()] = 0;
      for (long long int j = d[i].size() - 1; j >= 0; j--) {
        sum[i][j] = d[i][j] + sum[i][j + 1];
      }
    }
  }
  while (q--) {
    cin >> u >> v;
    u = hasComp[u];
    v = hasComp[v];
    if (u == v) {
      printf("-1\n");
      continue;
    }
    double anss = query(u, v);
    printf("%.8f\n", anss);
  }
}
