#include <bits/stdc++.h>
using namespace std;
int getint() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
int pre[112345], siz[112345];
int find(int x) {
  int res = pre[x];
  while (pre[res] != res) res = pre[res];
  int t;
  while (pre[x] != res) {
    t = pre[x];
    pre[x] = res;
    x = t;
  }
  return res;
}
void un(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) return;
  if (siz[x] < siz[y]) swap(x, y);
  pre[x] = y;
  siz[y] += siz[x];
}
int head[112345], etot;
struct edge {
  int to, next;
} e[112345 << 1];
void insert(int x, int y) {
  e[++etot].to = y;
  e[etot].next = head[x];
  head[x] = etot;
  e[++etot].to = x;
  e[etot].next = head[y];
  head[y] = etot;
}
struct data {
  int fi, se;
  data() { fi = se = 0; }
  void update(int x) {
    if (x > fi) {
      se = fi;
      fi = x;
    } else if (x > se) {
      se = x;
    }
    return;
  }
} f[112345];
int h[112345], fa[112345];
int dia[112345];
int dtmp, tmp[112345];
vector<long long> a[112345], b[112345], sa[112345], sb[112345];
void dfs1(int x) {
  for (int i = head[x]; i; i = e[i].next) {
    int y = e[i].to;
    if (y != fa[x]) {
      fa[y] = x;
      dfs1(y);
      f[x].update(f[y].fi + 1);
    }
  }
}
void dfs2(int x) {
  tmp[max(h[x], f[x].fi)]++;
  dtmp = max(dtmp, max(h[x] + f[x].fi, f[x].fi + f[x].se));
  for (int i = head[x]; i; i = e[i].next) {
    int y = e[i].to;
    if (y != fa[x]) {
      if (f[y].fi + 1 == f[x].fi)
        h[y] = max(h[x], f[x].se) + 1;
      else
        h[y] = max(h[x], f[x].fi) + 1;
      dfs2(y);
    }
  }
  return;
}
map<int, double> mp[112345];
double solve(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) return -1;
  if (siz[x] > siz[y]) swap(x, y);
  if (mp[x][y]) return mp[x][y];
  long long cnt = 0, sum = 0, d = max(dia[x], dia[y]);
  for (int i = 0; i < siz[x]; i++) {
    int j = max(0, (int)d - i);
    if (j < siz[y]) {
      cnt += (long long)a[x][i] * sa[y][j];
      sum += (long long)a[x][i] * sb[y][j];
      sum += (long long)b[x][i] * sa[y][j];
      sum += (long long)a[x][i] * sa[y][j];
    }
  }
  cnt = (long long)siz[x] * siz[y] - cnt;
  sum += cnt * d;
  double res = (double)sum / siz[x] / siz[y];
  mp[x][y] = res;
  return res;
}
int main() {
  int n = getint(), m = getint(), qq = getint();
  for (int i = 1; i <= n; i++) pre[i] = i, siz[i] = 1;
  for (int i = 1; i <= m; i++) {
    int x = getint(), y = getint();
    insert(x, y);
    un(x, y);
  }
  for (int i = 1; i <= n; i++)
    if (i == pre[i]) {
      for (int j = 0; j < siz[i]; j++) tmp[j] = 0;
      dtmp = 0;
      dfs1(i);
      dfs2(i);
      dia[i] = dtmp;
      for (int j = 0; j < siz[i]; j++)
        a[i].push_back(tmp[j]), b[i].push_back((long long)(j)*tmp[j]);
      sa[i] = a[i];
      sb[i] = b[i];
      for (int j = siz[i] - 2; j >= 0; j--) sa[i][j] += sa[i][j + 1];
      for (int j = siz[i] - 2; j >= 0; j--) sb[i][j] += sb[i][j + 1];
    }
  while (qq--) {
    int x = getint(), y = getint();
    printf("%.7lf\n", solve(x, y));
  }
  return 0;
}
