#include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
const long long infi64 = 1001001001001001001LL;
template <typename T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cout << *i << " ";
  cout << endl;
}
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
const int maxn = 110000;
int par[maxn], sz[maxn];
int down[maxn];
int diam[maxn];
vector<long long> ps[maxn];
vector<int> dp[maxn];
vector<int> g[maxn];
map<pair<int, int>, double> memo;
int root(int v) {
  if (par[v] == v) return v;
  return par[v] = root(par[v]);
}
void unite(int u, int v) {
  int s = root(u), t = root(v);
  if (s == t) return;
  if (sz[s] > sz[t]) swap(s, t);
  par[s] = t;
  sz[t] += sz[s];
}
void dfs(int v, int p) {
  for (int w : g[v]) {
    if (w == p) continue;
    dfs(w, v);
    uax(down[v], down[w] + 1);
  }
}
void update(int *mds, int d) {
  for (int i = 0; i < (int)(2); ++i) {
    if (mds[i] < d) swap(mds[i], d);
  }
}
int except(int *mds, int k) {
  for (int i = 0; i < (int)(2); ++i) {
    if (mds[i] == k)
      k = -1;
    else
      return mds[i];
  }
  return -1;
}
void dfs_up(int v, int p, int md_up, vector<int> &res) {
  res.push_back(max(md_up, down[v]));
  int mds[2]{-inf, -inf};
  for (int w : g[v]) {
    if (w == p) continue;
    update(mds, down[w]);
  }
  for (int w : g[v]) {
    if (w == p) continue;
    dfs_up(w, v, max(md_up, except(mds, down[w]) + 1) + 1, res);
  }
}
double solve(int u, int v) {
  if (u == v) return -1;
  if (sz[u] > sz[v]) swap(u, v);
  if (memo.count({u, v})) {
    return memo[{u, v}];
  }
  long long l = max(diam[u], diam[v]);
  long long k = sz[v];
  long long sum = 0;
  for (int s : dp[u]) {
    int index =
        upper_bound((dp[v]).begin(), (dp[v]).end(), l - s - 1) - dp[v].begin();
    sum += ps[v][k] - ps[v][index] + (k - index) * (1 + s) + l * index;
  }
  return memo[{u, v}] = (double)sum / ((long long)sz[u] * sz[v]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(7);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < (int)(n); ++i) par[i] = i, sz[i] = 1;
  for (int i = 0; i < (int)(m); ++i) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    unite(u, v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 0; i < (int)(n); ++i) {
    if (par[i] == i) {
      dfs(i, -1);
      dfs_up(i, -1, 0, dp[i]);
      sort((dp[i]).begin(), (dp[i]).end());
      diam[i] = dp[i].back();
      ps[i].resize(dp[i].size() + 1);
      for (int j = 0; j < (int)(dp[i].size()); ++j)
        ps[i][j + 1] = ps[i][j] + dp[i][j];
    }
  }
  for (int i = 0; i < (int)(q); ++i) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    u = root(u);
    v = root(v);
    cout << solve(u, v) << '\n';
  }
  return 0;
}
