#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1e5;
int n, m, q;
int pre[2 * MaxN + 5], last[MaxN + 5], other[2 * MaxN + 5], all;
int fa[MaxN + 5], seq[MaxN + 5];
bool vis[MaxN + 5];
double dis[MaxN + 5][3], dep[MaxN + 5];
vector<double> a[MaxN + 5], sum[MaxN + 5];
map<pair<int, int>, double> ans;
void Build(int x, int y) {
  pre[++all] = last[x];
  last[x] = all;
  other[all] = y;
}
void Dfs(int x, int father, int p) {
  fa[x] = p;
  int ed = last[x];
  while (ed != -1) {
    int dr = other[ed];
    if (dr != father) Dfs(dr, x, p);
    ed = pre[ed];
  }
}
int Bfs(int x, int p) {
  int head = 1, tail = 0;
  seq[++tail] = x;
  vis[x] = 1;
  dis[x][p] = 0.00;
  while (head <= tail) {
    int now = seq[head];
    int ed = last[now];
    while (ed != -1) {
      int dr = other[ed];
      if (!vis[dr]) {
        dis[dr][p] = dis[now][p] + 1.00;
        seq[++tail] = dr;
        vis[dr] = 1;
      }
      ed = pre[ed];
    }
    head++;
  }
  for (int i = 1; i <= tail; i++) vis[seq[i]] = 0;
  return seq[tail];
}
void dfs(int x, int father, int p) {
  dep[x] = max(dis[x][1], dis[x][2]);
  a[p].push_back(dep[x]);
  int ed = last[x];
  while (ed != -1) {
    int dr = other[ed];
    if (dr != father) dfs(dr, x, p);
    ed = pre[ed];
  }
}
void Solve(int x) {
  int u = Bfs(x, 1);
  int v = Bfs(u, 1);
  int temp = Bfs(v, 2);
  dfs(x, 0, x);
  sort(a[x].begin(), a[x].end());
  double res = 0;
  sum[x].push_back(res);
  for (int i = 0; i < a[x].size(); i++) {
    res += a[x][i];
    sum[x].push_back(res);
  }
}
void Print(int x, int y) {
  if (a[x].size() > a[y].size() || (a[x].size() == a[y].size() && x > y))
    swap(x, y);
  pair<int, int> g = make_pair(x, y);
  if (ans[g]) {
    printf("%.9lf\n", ans[g]);
    return;
  }
  double res = 0.00;
  double Max = max(a[x][a[x].size() - 1], a[y][a[y].size() - 1]);
  for (int i = 0; i < a[x].size(); i++) {
    int p =
        upper_bound(a[y].begin(), a[y].end(), Max - a[x][i] - 1) - a[y].begin();
    res += (Max * p) + (a[x][i] + 1.0) * (a[y].size() - p) +
           sum[y][sum[y].size() - 1] - sum[y][p];
  }
  res /= (double)a[x].size() * a[y].size();
  ans[g] = res;
  printf("%.9lf\n", ans[g]);
}
int main() {
  all = -1;
  memset(last, -1, sizeof(last));
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    Build(u, v);
    Build(v, u);
  }
  memset(fa, 0, sizeof(fa));
  memset(dis, 0, sizeof(dis));
  memset(dep, 0, sizeof(dep));
  for (int i = 1; i <= n; i++)
    if (!fa[i]) {
      Dfs(i, 0, i);
      Solve(i);
    }
  for (int i = 1; i <= q; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    if (fa[u] == fa[v])
      printf("-1\n");
    else {
      int c = fa[u], d = fa[v];
      Print(c, d);
    }
  }
}
