#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <typename T>
bool mllhen(T& x, T v) {
  if (v < x) {
    x = v;
    return true;
  }
  return false;
}
template <typename T>
bool maxthen(T& x, T v) {
  if (x < v) {
    x = v;
    return true;
  }
  return false;
}
constexpr ll N = 100001;
pair<ll, ll> m1[N], m2[N];
ll n, m, q, p[N], r[N], l[N], root[N], dist[N];
bool u1[N];
vector<ll> g[N], ds[N], sufs[N];
map<pair<ll, ll>, ld> ans;
ll dfind(ll x) { return x == p[x] ? x : p[x] = dfind(p[x]); }
void dunite(ll a, ll b) {
  a = dfind(a);
  b = dfind(b);
  if (a != b) {
    if (r[a] < r[b]) {
      p[a] = b;
      r[b] += r[a];
    } else {
      p[b] = a;
      r[a] += r[b];
    }
  }
}
void dfs1(ll v, ll p = -1) {
  m1[v] = m2[v] = {0, -1};
  for (ll t : g[v]) {
    if (t != p) {
      dfs1(t, v);
      if (l[t] + 1 > m1[v].first) {
        m2[v] = m1[v];
        m1[v] = {l[t] + 1, t};
      } else if (l[t] + 1 > m2[v].first) {
        m2[v] = {l[t] + 1, t};
      }
    }
  }
  l[v] = m1[v].first;
}
void dfs2(ll v, ll up = 0, ll p = -1) {
  dist[v] = max(m1[v].first, up);
  ds[dfind(v)].push_back(dist[v]);
  for (ll t : g[v]) {
    if (t != p) {
      ll newup = 1 + max(up, t != m1[v].second ? m1[v].first : m2[v].first);
      dfs2(t, newup, v);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> q;
  fill(r, r + n, 1);
  fill(l, l + n, -1);
  iota(p, p + n, 0);
  for (ll i = 0; i < m; ++i) {
    ll u, v;
    cin >> u >> v;
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
    dunite(u, v);
  }
  for (ll i = 0; i < n; ++i) {
    if (l[i] == -1) {
      root[dfind(i)] = root[i] = i;
      dfs1(i);
      dfs2(i);
      sort(begin(ds[dfind(i)]), end(ds[dfind(i)]));
      sufs[dfind(i)].resize(r[dfind(i)]);
      partial_sum(ds[dfind(i)].rbegin(), ds[dfind(i)].rend(),
                  sufs[dfind(i)].rbegin());
    } else
      root[i] = root[dfind(i)];
  }
  cout << fixed << setprecision(10);
  for (ll i = 0; i < q; ++i) {
    ll u, v;
    cin >> u >> v;
    --u;
    --v;
    pair<ll, ll> p = minmax(dfind(u), dfind(v));
    if (p.first == p.second)
      cout << -1 << '\n';
    else if (ans.count(p))
      cout << ans[p] << '\n';
    else {
      auto *v1_ = &ds[p.first], *v2_ = &ds[p.second];
      if (v1_->size() > v2_->size()) swap(v1_, v2_), swap(p.first, p.second);
      auto &v1 = *v1_, &v2 = *v2_;
      ll rem = 1LL * v1.size() * v2.size();
      ll def = max(v1.back(), v2.back());
      ld res = 0.0;
      for (ll i = 0; i < v1.size(); ++i) {
        auto it = upper_bound(begin(v2), end(v2), def - v1[i] - 1);
        ll j = it - begin(v2);
        ll c = v2.size() - j;
        if (it != v2.end()) res += c * (v1[i] + 1) + sufs[p.second][j];
        res += j * def;
      }
      res /= rem;
      ans[minmax(p.first, p.second)] = res;
      cout << res << '\n';
    }
  }
}
