#include <bits/stdc++.h>
using namespace std;
struct node {
  int firdis, secdis, fir, sec;
};
node tree[200000];
vector<int> vc[200000], aus[200000], my[200000];
long long id, tot[200000], rev[200000];
map<int, double> name[200000], vis[200000];
void insert(int v, int w, int dis) {
  if (tree[v].firdis < dis) {
    tree[v].secdis = tree[v].firdis;
    tree[v].sec = tree[v].fir;
    tree[v].firdis = dis;
    tree[v].fir = w;
    return;
  }
  if (tree[v].secdis < dis) {
    tree[v].secdis = dis;
    tree[v].sec = w;
  }
}
void dfs(int v, int par) {
  for (int i = 0; i < vc[v].size(); i++) {
    int w = vc[v][i];
    if (w == par) continue;
    dfs(w, v);
    insert(v, w, tree[w].firdis + 1);
  }
}
void dfs2(int v, int par) {
  rev[v] = id;
  if (v != par) {
    if (tree[par].fir != v)
      insert(v, par, tree[par].firdis + 1);
    else
      insert(v, par, tree[par].secdis + 1);
  }
  for (int i = 0; i < vc[v].size(); i++) {
    int w = vc[v][i];
    if (w == par) continue;
    dfs2(w, v);
  }
  my[id].push_back(tree[v].firdis);
}
double cal(int l, int k) {
  long long di = max(my[l][1], my[k][1]);
  double get = 0, sum = 0;
  for (int i = 1; i < my[l].size(); i++) {
    long long v = my[l][i];
    int lo = 0, high = my[k].size() - 1, mid, ans;
    while (lo <= high) {
      mid = (lo + high) / 2;
      if (my[k][mid] + 1 + v > di) {
        lo = mid + 1;
        ans = mid;
      } else
        high = mid - 1;
    }
    sum += aus[k][ans] + (ans * v) + ans;
    get += ans;
  }
  double c = tot[l] * tot[k], r;
  double d = c - get;
  sum += (d * di);
  return sum / c;
}
int main() {
  int i, j, k, l, m, n, q;
  scanf("%d%d%d", &n, &m, &q);
  int sq = sqrt(n);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &l, &k);
    vc[l].push_back(k);
    vc[k].push_back(l);
  }
  for (i = 1; i <= n; i++) {
    tree[i].firdis = 0;
    tree[i].fir = i;
    tree[i].secdis = -1;
    tree[i].sec = -1;
  }
  for (i = 1; i <= n; i++) {
    if (rev[i]) continue;
    id++;
    my[id].push_back(21474836);
    dfs(i, i);
    dfs2(i, i);
    sort(my[id].begin(), my[id].end());
    reverse(my[id].begin(), my[id].end());
    aus[id].push_back(0);
    for (int j = 1; j < my[id].size(); j++) {
      aus[id].push_back(aus[id][j - 1] + my[id][j]);
    }
    tot[id] = my[id].size() - 1;
  }
  while (q--) {
    scanf("%d%d", &l, &k);
    l = rev[l], k = rev[k];
    if (tot[l] > tot[k]) swap(l, k);
    if (l == k) {
      printf("-1\n");
      continue;
    }
    if (tot[l] >= sq && tot[k] >= sq) {
      if (vis[l][k])
        printf("%.8f\n", name[l][k]);
      else {
        vis[l][k] = 1;
        name[l][k] = cal(l, k);
        printf("%.8f\n", name[l][k]);
      }
      continue;
    }
    double d = cal(l, k);
    printf("%.8f\n", d);
  }
}
