#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
inline int chkmin(T& a, const T& val) {
  return val < a ? a = val, 1 : 0;
}
template <class T>
inline int chkmax(T& a, const T& val) {
  return a < val ? a = val, 1 : 0;
}
inline long long isqrt(long long k) {
  long long r = sqrt(k) + 1;
  while (r * r > k) r--;
  return r;
}
inline long long icbrt(long long k) {
  long long r = cbrt(k) + 1;
  while (r * r * r > k) r--;
  return r;
}
inline void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
inline void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
inline int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(long double x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(long double x, long double y) { return sign(x - y); }
const int maxn = 1e5 + 5;
int n, m, q;
vector<int> adj[maxn];
int ptr;
int f[maxn];
int from[maxn];
int size[maxn];
long long sum[maxn];
int g[maxn];
vector<int> v[maxn];
vector<long long> vv[maxn];
pair<int, int> best;
void dfs(int u, int p, int d) {
  chkmax(best, make_pair(d, u));
  f[u] = ptr;
  for (int i = (0); i < (int((adj[u]).size())); i++) {
    int v = adj[u][i];
    if (v != p) {
      from[v] = u;
      dfs(v, u, d + 1);
    }
  }
}
void upd(int u, int p, int d) {
  size[ptr]++;
  sum[ptr] += d + g[ptr] / 2;
  v[ptr].push_back(d + g[ptr] / 2);
  for (int i = (0); i < (int((adj[u]).size())); i++) {
    int v = adj[u][i];
    if (v != p) {
      upd(v, u, d + 1);
    }
  }
}
void findcenter(int u) {
  best = make_pair(0, 0), dfs(u, -1, 0);
  int st = best.second;
  best = make_pair(0, 0), dfs(st, -1, 0);
  int ed = best.second;
  vector<int> path;
  while (ed != st) {
    path.push_back(ed);
    ed = from[ed];
  }
  path.push_back(st);
  g[ptr] = int((path).size()) - 1;
  if (int((path).size()) & 1) {
    upd(path[int((path).size()) / 2], -1, 0);
  } else {
    int x = path[int((path).size()) / 2 - 1];
    int y = path[int((path).size()) / 2];
    upd(x, y, 1), upd(y, x, 1);
  }
}
map<int, long double> hs[maxn];
long double func(int x, int y) {
  if (hs[x].count(y)) return hs[x][y];
  long double& res = hs[x][y];
  for (int i = (0); i < (int((v[x]).size())); i++) {
    int val = v[x][i];
    int mx = max(g[x], g[y]);
    int k =
        upper_bound((v[y]).begin(), (v[y]).end(), mx - val - 1) - v[y].begin();
    if (k) {
      res -= (long double)val * k;
      res -= vv[y][k - 1];
      res += (long double)k * (mx - 1);
    }
  }
  return res;
}
void solve() {
  cin >> n >> m >> q;
  for (int i = (0); i < (m); i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v), adj[v].push_back(u);
  }
  for (int i = (0); i < (n); i++)
    if (!f[i]) {
      ptr++;
      findcenter(i);
      sort((v[ptr]).begin(), (v[ptr]).end());
      long long tot = 0;
      for (int j = (0); j < (int((v[ptr]).size())); j++) {
        tot += v[ptr][j];
        vv[ptr].push_back(tot);
      }
    }
  for (int i = (0); i < (q); i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    x = f[x], y = f[y];
    if (x != y) {
      long double ans =
          (long double)sum[x] / size[x] + (long double)sum[y] / size[y];
      if (make_pair(int((v[x]).size()), x) > make_pair(int((v[y]).size()), y)) {
        swap(x, y);
      }
      ans += func(x, y) / size[x] / size[y];
      cout << fixed << setprecision(9) << ans + 1 << "\n";
    } else {
      cout << -1 << "\n";
    }
  }
}
int main() {
  int JUDGE_ONLINE = 1;
  if (fopen("in.txt", "r")) {
    JUDGE_ONLINE = 0;
    assert(freopen("in.txt", "r", stdin));
  } else {
    ios_base::sync_with_stdio(0), cin.tie(0);
  }
  solve();
  if (!JUDGE_ONLINE) {
  }
  return 0;
}
