#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, query;
int l[N], d[N][3], dia[N];
vector<long long> sum[N];
vector<int> a[N], c[N];
map<pair<int, int>, double> mymap;
map<pair<int, int>, int> check;
int root(int u) { return (l[u] < 0 ? u : (l[u] = root(l[u]))); }
void doJoin(int u, int v) {
  u = root(u);
  v = root(v);
  if (u == v) return;
  if (l[u] > l[v]) swap(u, v);
  l[u] += l[v];
  l[v] = u;
}
void read() {
  cin >> n >> m >> query;
  for (int i = 1; i <= n; i++) l[i] = -1;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    a[u].push_back(v);
    a[v].push_back(u);
    doJoin(u, v);
  }
}
void visit(int u, int t) {
  for (int i = 1; i <= a[u].size(); i++) {
    int v = a[u][i - 1];
    if (d[v][t] == 0) {
      d[v][t] = d[u][t] + 1;
      visit(v, t);
    }
  }
}
bool cmp(int u, int v) { return d[u][0] < d[v][0]; }
void update(int cpn) {
  if (c[cpn].size() == 1) {
    sum[cpn].push_back(0);
    return;
  }
  d[c[cpn][0]][1] = 1;
  visit(c[cpn][0], 1);
  int r1 = c[cpn][0], r2 = c[cpn][0];
  for (int i = 1; i <= c[cpn].size(); i++)
    if (d[c[cpn][i - 1]][1] > d[r1][1]) r1 = c[cpn][i - 1];
  for (int i = 1; i <= c[cpn].size(); i++) d[c[cpn][i - 1]][1] = 0;
  d[r1][1] = 1;
  visit(r1, 1);
  for (int i = 1; i <= c[cpn].size(); i++)
    if (d[c[cpn][i - 1]][1] > d[r2][1]) r2 = c[cpn][i - 1];
  d[r2][2] = 1;
  visit(r2, 2);
  dia[cpn] = d[r1][2] - 1;
  for (int i = 1; i <= c[cpn].size(); i++) {
    int u = c[cpn][i - 1];
    d[u][0] = max(d[u][1], d[u][2]) - 1;
  }
  sort(c[cpn].begin(), c[cpn].end(), cmp);
  int tmp = 0;
  for (int i = 1; i <= c[cpn].size(); i++) {
    sum[cpn].push_back(tmp + d[c[cpn][i - 1]][0]);
    tmp += d[c[cpn][i - 1]][0];
  }
}
double cal(int u, int v) {
  double P = 0, Q = (double)c[u].size() * c[v].size();
  if (c[u].size() > c[v].size()) swap(u, v);
  int pos = c[v].size();
  for (int i = 1; i <= c[u].size(); i++) {
    int iu = c[u][i - 1];
    int len = max(dia[u], dia[v]);
    while (pos > 0 && d[c[v][pos - 1]][0] >= len - d[iu][0] - 1) pos--;
    P +=
        (double)(sum[v][sum[v].size() - 1] - (pos == 0 ? 0 : sum[v][pos - 1])) +
        (double)len * pos;
    P += (c[v].size() - pos) * (1 + d[iu][0]);
  }
  if (u > v) swap(u, v);
  check[pair<int, int>(u, v)] = 1;
  return mymap[pair<int, int>(u, v)] = P / Q;
}
void solve() {
  for (int i = 1; i <= n; i++) {
    root(i);
    if (l[i] > 0)
      c[l[i]].push_back(i);
    else
      c[i].push_back(i);
  }
  for (int i = 1; i <= n; i++)
    if (l[i] < 0) update(i);
  cout.precision(7);
  for (int i = 1; i <= query; i++) {
    int u, v;
    cin >> u >> v;
    u = root(u);
    v = root(v);
    if (u > v) swap(u, v);
    if (u == v)
      cout << -1 << '\n';
    else if (c[u].size() == 1 && c[v].size() == 1)
      cout << "1.0000000\n";
    else if (check[pair<int, int>(u, v)])
      cout << fixed << mymap[pair<int, int>(u, v)] << '\n';
    else {
      cout << fixed << cal(u, v) << '\n';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  read();
  solve();
  return 0;
}
