Pasha is a good student and one of MoJaK's best friends. He always have a problem to think about. Today they had a talk about the following problem.

We have a forest (acyclic undirected graph) with n vertices and m edges. There are q queries we should answer. In each query two vertices v and u are given. Let V be the set of vertices in the connected component of the graph that contains v, and U be the set of vertices in the connected component of the graph that contains u. Let's add an edge between some vertex <image> and some vertex in <image> and compute the value d of the resulting component. If the resulting component is a tree, the value d is the diameter of the component, and it is equal to -1 otherwise. What is the expected value of d, if we choose vertices a and b from the sets uniformly at random?

Can you help Pasha to solve this problem?

The diameter of the component is the maximum distance among some pair of vertices in the component. The distance between two vertices is the minimum number of edges on some path between the two vertices.

Note that queries don't add edges to the initial forest. 

Input

The first line contains three integers n, m and q(1 ≤ n, m, q ≤ 105) — the number of vertices, the number of edges in the graph and the number of queries.

Each of the next m lines contains two integers ui and vi (1 ≤ ui, vi ≤ n), that means there is an edge between vertices ui and vi.

It is guaranteed that the given graph is a forest.

Each of the next q lines contains two integers ui and vi (1 ≤ ui, vi ≤ n) — the vertices given in the i-th query.

Output

For each query print the expected value of d as described in the problem statement.

Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6. Let's assume that your answer is a, and the jury's answer is b. The checker program will consider your answer correct, if <image>.

Examples

Input

3 1 2
1 3
3 1
2 3


Output

-1
2.0000000000


Input

5 2 3
2 4
4 3
4 2
4 1
2 5


Output

-1
2.6666666667
2.6666666667

Note

In the first example the vertices 1 and 3 are in the same component, so the answer for the first query is -1. For the second query there are two options to add the edge: one option is to add the edge 1 - 2, the other one is 2 - 3. In both ways the resulting diameter is 2, so the answer is 2.

In the second example the answer for the first query is obviously -1. The answer for the second query is the average of three cases: for added edges 1 - 2 or 1 - 3 the diameter is 3, and for added edge 1 - 4 the diameter is 2. Thus, the answer is <image>.
#include <bits/stdc++.h>
using namespace std;
int fa[100005], judge[100005];
int mx[100005], dis[100005];
int num[100005];
bool vis[100005];
vector<int> tot[100005];
vector<int> edge[100005];
vector<long long> pre[100005];
long long maxdis;
int maxpos;
queue<int> q;
map<long, double> mp;
void BFS(int x) {
  while (!q.empty()) q.pop();
  q.push(x);
  while (!q.empty()) {
    int temp = q.front();
    q.pop();
    if (vis[temp]) continue;
    vis[temp] = 1;
    if (dis[temp] > maxdis) {
      maxdis = dis[temp];
      maxpos = temp;
    }
    for (int i = 0; i < edge[temp].size(); i++) {
      if (!vis[edge[temp][i]]) {
        dis[edge[temp][i]] = dis[temp] + 1;
        q.push(edge[temp][i]);
      }
    }
  }
}
void dfs(int i, int dep, int coo) {
  for (int j = 0; j < edge[i].size(); j++) {
    int temp = edge[i][j];
    if (judge[temp] == coo)
      continue;
    else {
      mx[temp] = max(mx[temp], (dep + 1));
      judge[temp]++;
      dfs(temp, dep + 1, coo);
    }
  }
}
int getfa(int i) {
  if (fa[i] != i)
    return fa[i] = getfa(fa[i]);
  else
    return fa[i];
}
void uni(int a, int b) {
  getfa(a);
  getfa(b);
  fa[fa[a]] = fa[b];
}
int main() {
  int n, m, q, u, v;
  cin >> n >> m >> q;
  memset(vis, 0, sizeof(vis));
  memset(mx, 0, sizeof(mx));
  memset(judge, 0, sizeof(judge));
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
    uni(u, v);
  }
  for (int i = 1; i <= n; i++) {
    getfa(i);
  }
  int id = 1;
  for (int i = 1; i <= n; i++) {
    if (fa[i] == i) {
      num[fa[i]] = id++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!judge[i]) {
      maxdis = 0;
      maxpos = i;
      memset(vis, 0, sizeof(vis));
      memset(dis, 0, sizeof(dis));
      BFS(i);
      judge[maxpos]++;
      dfs(maxpos, 0, 1);
      maxdis = 0;
      memset(vis, 0, sizeof(vis));
      memset(dis, 0, sizeof(dis));
      BFS(maxpos);
      judge[maxpos]++;
      dfs(maxpos, 0, 2);
    }
  }
  for (int i = 1; i <= n; i++) tot[fa[i]].push_back(mx[i]);
  for (int i = 1; i <= n; i++) sort(tot[i].begin(), tot[i].end());
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < tot[i].size(); j++) {
      pre[i].push_back(tot[i][j]);
    }
    for (int j = 1; j < pre[i].size(); j++) {
      pre[i][j] += pre[i][j - 1];
    }
  }
  while (q--) {
    scanf("%d%d", &u, &v);
    if (fa[u] == fa[v]) {
      printf("-1\n");
      continue;
    }
    if (mp[num[fa[u]] * id + num[fa[v]]] != 0 && id <= 10000) {
      printf("%.10lf\n", mp[num[fa[u]] * id + num[fa[v]]]);
      continue;
    }
    double ans = 0;
    long long mxx = max(tot[fa[u]][tot[fa[u]].size() - 1],
                        tot[fa[v]][tot[fa[v]].size() - 1]);
    if (tot[fa[u]].size() == 0 && tot[fa[v]].size() == 0) {
      ans = 0;
    } else if (tot[fa[u]].size() == 0) {
      ans = (double)(pre[fa[v]][tot[fa[v]].size() - 1]) /
            (double)(tot[fa[v]].size());
    } else if (tot[fa[v]].size() == 0) {
      ans = (double)(pre[fa[u]][tot[fa[u]].size() - 1]) /
            (double)(tot[fa[u]].size());
    } else {
      if (tot[fa[u]].size() > tot[fa[v]].size()) swap(u, v);
      for (int i = 0; i < tot[fa[u]].size(); i++) {
        long long su = 0;
        if (tot[fa[v]][tot[fa[v]].size() - 1] + tot[fa[u]][i] + 1 <= mxx) {
          su += ((mxx - 1) * tot[fa[v]].size());
        } else if ((tot[fa[v]][0] + tot[fa[u]][i] + 1) >= mxx) {
          su += (pre[fa[v]][tot[fa[v]].size() - 1]);
          su += (tot[fa[u]][i] * tot[fa[v]].size());
        } else {
          long long temp = lower_bound(tot[fa[v]].begin(), tot[fa[v]].end(),
                                       mxx - tot[fa[u]][i] - 1) -
                           tot[fa[v]].begin();
          su += (pre[fa[v]][tot[fa[v]].size() - 1] - pre[fa[v]][temp - 1] +
                 tot[fa[u]][i] * (tot[fa[v]].size() - temp));
          su += ((mxx - 1) * (temp));
        }
        ans += (double)su / (double)(tot[fa[v]].size() * tot[fa[u]].size());
      }
    }
    ans += 1;
    printf("%.10lf\n", ans);
    mp[num[fa[u]] * id + num[fa[v]]] = ans;
    mp[num[fa[v]] * id + num[fa[u]]] = ans;
  }
}
