#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:300777216")
std::uniform_int_distribution<std::mt19937::result_type> udist(0, 1);
std::mt19937 rng;
using namespace std;
FILE *in, *out;
int ri() {
  int a;
  fscanf(in, "%d", &a);
  return a;
}
double rf() {
  double a;
  fscanf(in, "%lf", &a);
  return a;
}
char sbuf[100005];
string rstr() {
  char c;
  char *b = sbuf;
  while (c = fgetc(in)) {
    if (c == '\n' || c == 255) break;
    *b++ = c;
  }
  *b = 0;
  return sbuf;
}
long long nod(long long a, long long b) {
  if (a == 1 || b == 1) return 1;
  if (a == 0) return b;
  if (b == 0) return a;
  return nod(b % a, a);
}
vector<int> primes;
void calculatePrimes() {
  primes.push_back(2);
  for (int i = 3; i < 500000; i += 2) {
    bool bFound = false;
    int m = (int)sqrt((float)i);
    for (int j = 1; j < primes.size() && !bFound && primes[j] <= m; j++)
      bFound = ((i % primes[j]) == 0);
    if (!bFound) primes.push_back(i);
  }
}
void egcd(int a, int b, int &g, int &x, int &y) {
  if (a == 0) {
    g = b;
    x = 0;
    y = 1;
    return;
  }
  egcd(b % a, a, g, y, x);
  x = x - (b / a) * y;
}
int modinv(int a, int m) {
  int g = 0, x = 0, y = 0;
  egcd(a, m, g, x, y);
  return (x + m) % m;
}
struct Node {
  int status;
  int ss;
  int max1, max1i, max2, max2i, cf;
  Node() {
    status = 0;
    ss = -1;
    max1 = 0;
    max2 = 0;
    max1i = -2;
    max2i = -2;
    cf = -1;
  }
};
vector<vector<int>> tr;
vector<Node> nt;
int trav(int cn, int cf, int ss) {
  if (nt[cn].status == 0) {
    nt[cn].ss = ss;
    nt[cn].cf = cf;
    for (auto v : tr[cn]) {
      if (v == cf) continue;
      int cl = trav(v, cn, ss);
      if (cl >= nt[cn].max1) {
        nt[cn].max2 = nt[cn].max1;
        nt[cn].max2i = nt[cn].max2i;
        nt[cn].max1 = cl;
        nt[cn].max1i = v;
      } else if (cl > nt[cn].max2) {
        nt[cn].max2 = cl;
        nt[cn].max2i = v;
      }
    }
    if (cf == -1)
      nt[cn].status = 2;
    else
      nt[cn].status = 1;
  } else if (nt[cn].status == 1) {
    if (cf != nt[cn].cf) {
      int cl = trav(nt[cn].cf, cn, ss);
      if (cl >= nt[cn].max1) {
        nt[cn].max2 = nt[cn].max1;
        nt[cn].max2i = nt[cn].max2i;
        nt[cn].max1 = cl;
        nt[cn].max1i = nt[cn].cf;
      } else if (cl > nt[cn].max2) {
        nt[cn].max2 = cl;
        nt[cn].max2i = nt[cn].cf;
      }
      nt[cn].cf = -1;
      nt[cn].status = 2;
    }
  }
  return cf == nt[cn].max1i ? nt[cn].max2 + 1 : nt[cn].max1 + 1;
}
double glue(vector<int> &a, vector<long long> &as, vector<int> &b,
            vector<long long> &bs) {
  if (a.size() > b.size()) return glue(b, bs, a, as);
  int minlen = max(*a.rbegin(), *b.rbegin());
  double sum = 0;
  for (int i = (0); i < (((a.size()))); ++i) {
    if (a[i] + b[0] + 1 >= minlen)
      sum += (a[i] + 1) * (long long)b.size() + *bs.rbegin();
    else {
      auto it = lower_bound(b.begin(), b.end(), minlen - a[i] - 1);
      int count = it - b.begin();
      sum += (a[i] + 1) * (long long)(b.size() - count) + *bs.rbegin() +
             count * (long long)minlen - bs[count];
    }
  }
  return sum / a.size() / b.size();
}
map<pair<int, int>, double> cache;
int main() {
  long long n = 500, m, k;
  cin >> n >> m >> k;
  tr.resize(n);
  nt.resize(n);
  for (int i = (0); i < (((m))); ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    tr[a].push_back(b);
    tr[b].push_back(a);
  }
  int cs = 1;
  for (int i = (0); i < (((n))); ++i) {
    if (nt[i].ss == -1) nt[i].ss = cs++;
    trav(i, -1, nt[i].ss);
  }
  vector<vector<int>> md(cs);
  vector<vector<long long>> smd(cs);
  for (int i = (0); i < (((n))); ++i) {
    md[nt[i].ss].push_back(nt[i].max1);
  }
  for (int i = (0); i < (((cs))); ++i) {
    sort(md[i].begin(), md[i].end());
    smd[i].resize(md[i].size() + 1);
    smd[i][0] = 0;
    for (int j = (0); j < (((md[i].size()))); ++j)
      smd[i][j + 1] = smd[i][j] + md[i][j];
  }
  for (int i = (0); i < (((k))); ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    a = nt[a].ss;
    b = nt[b].ss;
    if (a == b) {
      cout << -1 << endl;
      continue;
    }
    if (md[a].size() > md[b].size()) swap(a, b);
    if (cache.find(make_pair(a, b)) == cache.end()) {
      cache[make_pair(a, b)] = glue(md[a], smd[a], md[b], smd[b]);
    }
    printf("%.10f\n", cache[make_pair(a, b)]);
  }
  return 0;
}
