#include <bits/stdc++.h>
using namespace std;
long long t, n, m, u, v, q, k;
const int N = 1e5 + 500;
const int SN = 320;
const long long mod = 1e9 + 7;
const long long INF = 1LL << 57;
long long arr[N];
string str, ss;
int far[N], farthest[N];
bool vis[N];
int col[N], sz[N], diam[N];
vector<int> has[N];
vector<int> adj[N];
void dfs(int v, int p, int color) {
  col[v] = color;
  sz[color]++;
  vis[v] = true;
  for (int u : adj[v]) {
    if (u == p) continue;
    dfs(u, v, color);
    far[v] = max(far[v], far[u] + 1);
  }
  diam[color] = max(diam[color], far[v]);
}
void solve(int v, int p, int upper) {
  vector<int> cur;
  vis[v] = true;
  for (int u : adj[v]) {
    if (u == p) continue;
    cur.push_back(far[u]);
  }
  sort(cur.begin(), cur.end());
  farthest[v] = max(far[v], upper);
  has[col[v]].push_back(max(upper, far[v]));
  reverse(cur.begin(), cur.end());
  if (cur.size() > 1) diam[col[v]] = max(diam[col[v]], cur[0] + cur[1] + 2);
  for (int u : adj[v]) {
    if (u == p) continue;
    int send = upper + 1;
    if (far[u] != cur[0])
      send = max(send, cur[0] + 2);
    else {
      if (cur.size() > 1) send = max(send, cur[1] + 2);
    }
    solve(u, v, send);
  }
}
bool isbig[N];
vector<int> bigcomp;
int idx[N];
long double sol[SN + 10][SN + 10];
vector<long long> pref[N];
long double compsolve(int u, int v) {
  long double ret = 0.0;
  if (sz[u] > sz[v]) swap(u, v);
  int res = max(diam[u], diam[v]);
  for (int i = 0; i < has[u].size(); ++i) {
    int x = lower_bound(has[v].begin(), has[v].end(), res - has[u][i] - 1) -
            has[v].begin();
    int y = has[v].size() - x;
    ret += ((long double)1 / (long double)has[u].size()) *
           ((long double)x * (long double)res / (long double)has[v].size());
    long double tt = pref[v].back();
    if (x > 0) tt -= pref[v][x - 1];
    tt += y * has[u][i];
    tt += y;
    ret += ((long double)1 / (long double)has[u].size()) *
           ((long double)(tt) / (long double)has[v].size());
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> q;
  for (int i = 1; i <= m; ++i) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int x = 0;
  for (int i = 1; i <= n; ++i) {
    if (vis[i]) continue;
    dfs(i, 0, x);
    x++;
  }
  memset(vis, false, sizeof(vis));
  for (int i = 1; i <= n; ++i) {
    if (vis[i]) continue;
    solve(i, 0, 0);
  }
  for (int i = 0; i < x; ++i) {
    sort(has[i].begin(), has[i].end());
    pref[i].resize(has[i].size());
    pref[i][0] = has[i][0];
    for (int j = 1; j < has[i].size(); ++j) {
      pref[i][j] = pref[i][j - 1] + has[i][j];
    }
    if (sz[i] >= SN) {
      isbig[i] = true;
      bigcomp.push_back(i);
      idx[i] = (int)bigcomp.size() - 1;
    }
  }
  for (int i = 0; i < bigcomp.size(); ++i) {
    for (int j = i + 1; j < bigcomp.size(); ++j) {
      sol[i][j] = compsolve(bigcomp[i], bigcomp[j]);
    }
  }
  while (q--) {
    cin >> u >> v;
    u = col[u];
    v = col[v];
    if (u == v) {
      cout << -1 << '\n';
      continue;
    }
    if (isbig[u] && isbig[v]) {
      int i = idx[u];
      int j = idx[v];
      if (i > j) swap(i, j);
      cout << fixed << setprecision(7) << sol[i][j] << '\n';
    } else
      cout << fixed << setprecision(7) << compsolve(u, v) << '\n';
  }
  return 0;
}
