#include <bits/stdc++.h>
using namespace std;
clock_t start;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());
template <typename T>
void _F(const char *name, T arg1) {
  cerr << name << " = " << arg1 << '\n';
}
template <typename T, typename... Args>
void _F(const char *names, T arg1, Args... args) {
  const char *name = strchr(names, ',');
  cerr.write(names, name - names) << " = " << arg1 << '\n';
  _F(name + 2, args...);
}
template <typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &q) {
  in >> q.first >> q.second;
  return in;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, pair<T1, T2> &q) {
  out << q.first << " " << q.second;
  return out;
}
template <typename T1, typename T2>
pair<T1, T2> operator+(pair<T1, T2> p1, pair<T1, T2> p2) {
  return {p1.first + p2.first, p1.second + p2.second};
}
template <typename T1, typename T2>
pair<T1, T2> operator-(pair<T1, T2> p1, pair<T1, T2> p2) {
  return {p1.first - p2.first, p1.second - p2.second};
}
const long long N = 1e5 + 10;
std::vector<long long> g[N], vis(N), con[N], tmp(N), sum[N];
long long dia[N], u, n, m, v, q, dis[N];
struct Dsu {
  long long par[N], siz[N];
  bool tree[N];
  Dsu() {
    for (long long i = 0; i < N; i++) {
      par[i] = i;
      siz[i] = 1;
      tree[i] = 1;
    }
  }
  long long Root(long long x) {
    if (x == par[x]) return x;
    return par[x] = Root(par[x]);
  }
  void Merge(long long x, long long y) {
    x = Root(x), y = Root(y);
    if (x == y) {
      tree[x] = 0;
      return;
    }
    if (siz[y] > siz[x]) swap(x, y);
    par[y] = par[x];
    siz[x] += siz[y];
  }
} ds0, ds1;
void dfs1(long long v) {
  vis[v] = 1;
  for (auto u : g[v]) {
    if (vis[u]) continue;
    dfs1(u);
    dis[v] = max(dis[v], dis[u] + 1);
  }
}
void dfs2(long long v, long long x) {
  dis[v] = max(dis[v], x + 1);
  multiset<long long> s;
  s.insert(x + 1);
  for (auto u : g[v]) {
    if (!tmp[u]) {
      s.insert(dis[u] + 1);
    }
  }
  tmp[v] = 1;
  for (auto u : g[v]) {
    if (tmp[u]) continue;
    x = dis[u] + 1;
    s.erase(s.find(x));
    dfs2(u, *(--end(s)));
    s.insert(x);
  }
}
void max_dia(long long v) {
  dfs1(v);
  dfs2(v, -1);
}
map<pair<long long, long long>, double> is;
void solve() {
  cin >> n >> m >> q;
  for (long long i = 1; i <= m; i++) {
    cin >> u >> v;
    ds0.Merge(u, v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (long long i = 1; i <= n; i++) {
    if (!vis[i] && ds0.tree[ds0.Root(i)]) {
      max_dia(i);
    }
    con[ds0.Root(i)].push_back(dis[i]);
    dia[ds0.Root(i)] = max(dia[ds0.Root(i)], dis[i]);
  }
  for (long long i = 1; i <= n; i++) {
    sort((con[i]).begin(), (con[i]).end());
    for (auto u : con[i]) {
      if ((long long)((sum[i]).size())) {
        sum[i].push_back(sum[i].back() + u);
      } else {
        sum[i].push_back(u);
      }
    }
  }
  while (q--) {
    cin >> u >> v;
    u = ds0.Root(u);
    v = ds0.Root(v);
    if (u == v || !ds0.tree[u] || !ds0.tree[v]) {
      cout << -1 << '\n';
    } else if (is[{u, v}]) {
      cout << is[{u, v}] << '\n';
    } else if (is[{v, u}]) {
      cout << is[{v, u}] << '\n';
    } else {
      long long mx = max(dia[u], dia[v]);
      long long ss = ds0.siz[u] * ds0.siz[v];
      if ((long long)((con[u]).size()) > (long long)((con[v]).size()))
        swap(u, v);
      long long tot =
          sum[u].back() * ds0.siz[v] + sum[v].back() * ds0.siz[u] + ss;
      for (auto i : con[u]) {
        long long j = (long long)(upper_bound((con[v]).begin(), (con[v]).end(),
                                              mx - i - 1) -
                                  begin(con[v]));
        j--;
        if (j >= 0) {
          tot -= sum[v][j] + (j + 1) * i;
          tot -= (j + 1);
          tot += (j + 1) * mx;
        }
      }
      is[{u, v}] = (double)(tot);
      is[{u, v}] /= ss;
      cout << is[{u, v}] << '\n';
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  start = clock();
  cout << fixed << setprecision(20);
  for (long long i = 1; i <= t; ++i) {
    solve();
  }
  return 0;
}
