#include <bits/stdc++.h>
const long long inf = 1e9 + 7;
using namespace std;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f * x;
}
struct edge {
  int t;
  edge *next;
} e[400005], *h[100005], *o = e;
void add(int x, int y) {
  o->t = y;
  o->next = h[x];
  h[x] = o++;
}
int n, m, q;
int tmp[100005][3], f[100005], len[100005], id[100005], size[100005], tot, _x,
    _y;
vector<int> b[100005];
vector<long long> sum[100005];
double ans[100005];
struct tmp {
  int x, y, i;
  bool operator<(const tmp &o) const {
    return size[x] < size[o.x] || (size[x] == size[o.y] && y < o.y);
  }
} c[100005];
int find(int x) { return f[x] == x ? x : f[x] = find(f[x]); }
void dfs1(int x) {
  id[x] = tot;
  for (edge *j = h[x]; j; j = j->next)
    if (j->t != f[x]) {
      f[j->t] = x;
      dfs1(j->t);
      if (tmp[j->t][1] + 1 > tmp[x][1])
        tmp[x][2] = tmp[x][1], tmp[x][1] = tmp[j->t][1] + 1;
      else if (tmp[j->t][1] + 1 > tmp[x][2])
        tmp[x][2] = tmp[j->t][1] + 1;
    }
}
void dfs2(int x) {
  b[tot].push_back(tmp[x][1]);
  len[tot] = max(len[tot], tmp[x][1] + tmp[x][2]);
  for (edge *j = h[x]; j; j = j->next)
    if (j->t != f[x]) {
      if (tmp[x][1] == tmp[j->t][1] + 1) {
        if (tmp[x][2] + 1 > tmp[j->t][1])
          tmp[j->t][2] = tmp[j->t][1], tmp[j->t][1] = tmp[x][2] + 1;
        else if (tmp[x][2] + 1 > tmp[j->t][2])
          tmp[j->t][2] = tmp[x][2] + 1;
      } else {
        if (tmp[x][1] + 1 > tmp[j->t][1])
          tmp[j->t][2] = tmp[j->t][1], tmp[j->t][1] = tmp[x][1] + 1;
        else if (tmp[x][1] + 1 > tmp[j->t][2])
          tmp[j->t][2] = tmp[x][1] + 1;
      }
      dfs2(j->t);
    }
}
int main() {
  n = read();
  m = read();
  q = read();
  for (int i = 1; i <= n; i++) f[i] = i;
  for (int i = 1; i <= m; i++) {
    _x = read();
    _y = read();
    add(_x, _y);
    add(_y, _x);
    int x = find(_x), y = find(_y);
    f[x] = y;
  }
  for (int i = 1; i <= n; i++)
    if (f[i] == i) {
      tot++;
      dfs1(i);
      dfs2(i);
      size[tot] = b[tot].size();
      sort(b[tot].begin(), b[tot].end());
      sum[tot].push_back(b[tot][0]);
      for (int j = 1; j <= size[tot] - 1; j++)
        sum[tot].push_back(sum[tot][j - 1] + b[tot][j]);
    }
  for (int i = 1; i <= q; i++) {
    c[i].x = id[read()];
    c[i].y = id[read()];
    c[i].i = i;
    if (size[c[i].x] > size[c[i].y]) swap(c[i].x, c[i].y);
  }
  sort(c + 1, c + 1 + q);
  for (int i = 1; i <= q; i++) ans[i] = -1;
  for (int i = 1; i <= q; i++)
    if (c[i].x == c[i - 1].x && c[i].y == c[i - 1].y)
      ans[c[i].i] = ans[c[i - 1].i];
    else {
      int x = c[i].x, y = c[i].y;
      int cnt = max(len[x], len[y]);
      if (x == y) continue;
      ans[c[i].i] = sum[x][size[x] - 1] * size[y] +
                    sum[y][size[y] - 1] * size[x] +
                    (long long)size[x] * size[y];
      for (auto &j : b[x])
        if (j + b[y][0] + 1 < cnt) {
          int t =
              lower_bound(b[y].begin(), b[y].end(), cnt - 1 - j) - b[y].begin();
          ans[c[i].i] -= (long long)j * t + sum[y][t - 1] + t;
          ans[c[i].i] += (long long)t * cnt;
        }
      ans[c[i].i] /= size[x];
      ans[c[i].i] /= size[y];
    }
  for (int i = 1; i <= q; i++) printf("%.8lf\n", ans[i]);
  return 0;
}
