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>.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.Map;
import java.io.BufferedReader;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Hieu Le
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskF solver = new TaskF();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF {
        private static final int INF = (int) 1e9;
        private int[] parents;
        private int[] diameters;
        private List<Integer>[] distances;
        private long[][] prefixSums;
        private Map<TaskF.IntPair, Double> cache;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int nNodes = in.nextInt();
            int nEdges = in.nextInt();
            int nQueries = in.nextInt();

            Node[] nodes = new Node[nNodes];
            for (int i = 0; i < nNodes; ++i)
                nodes[i] = new Node();

            parents = new int[nNodes];
            Arrays.fill(parents, -1);
            for (int i = 0; i < nEdges; ++i) {
                int u = in.nextInt() - 1;
                int v = in.nextInt() - 1;
                nodes[u].adj.add(nodes[v]);
                nodes[v].adj.add(nodes[u]);
                if (getParent(u) != getParent(v))
                    union(u, v);
            }

            distances = new List[nNodes];
            diameters = new int[nNodes];
            prefixSums = new long[nNodes][];
            for (int i = 0; i < nNodes; ++i) {
                if (parents[i] < 0) {  // Is root node.
                    distances[i] = new ArrayList<>();
                    nodes[i].dfs0(null);
                    diameters[i] = nodes[i].dfs1(null, 0, distances[i]);
                    Collections.sort(distances[i]);
                    prefixSums[i] = new long[distances[i].size()];
                    prefixSums[i][0] = distances[i].get(0);
                    for (int j = 1; j < distances[i].size(); ++j)
                        prefixSums[i][j] = prefixSums[i][j - 1] + distances[i].get(j);
                }
            }

            cache = new HashMap<>();
            for (int q = 0; q < nQueries; ++q) {
                int pu = getParent(in.nextInt() - 1);
                int pv = getParent(in.nextInt() - 1);
                if (pu == pv) {
                    out.println(-1);
                    continue;
                }

                out.printf("%.7f\n", process(pu, pv));
            }
        }

        private double process(int pu, int pv) {
            if (parents[pu] < parents[pv]) {
                int temp = pu;
                pu = pv;
                pv = temp;
            }

            TaskF.IntPair pair = new TaskF.IntPair(pu, pv);
            if (cache.containsKey(pair))
                return cache.get(pair);

            List<Integer> vDist = distances[pv];
            int diameter = Math.max(diameters[pu], diameters[pv]);

            long sum = 0;
            for (int dist : distances[pu]) {
                if (vDist.get(vDist.size() - 1) + dist + 1 <= diameter) {
                    sum += (long) diameter * vDist.size();
                } else {
                    int low = 0, high = vDist.size() - 1;
                    while (low < high) {
                        int mid = low + (high - low) / 2;
                        if (vDist.get(mid) + dist + 1 > diameter)
                            high = mid;
                        else
                            low = mid + 1;
                    }
                    sum += (long) diameter * low;
                    sum += (long) (dist + 1) * (vDist.size() - low);
                    sum += getPrefixSum(prefixSums[pv], low, vDist.size() - 1);
                }
            }
            double result = (double) sum / ((long) parents[pu] * parents[pv]);
            cache.put(pair, result);
            return result;
        }

        private long getPrefixSum(long[] prefixSum, int low, int high) {
            return low == 0 ? prefixSum[high] : prefixSum[high] - prefixSum[low - 1];
        }

        private void union(int u, int v) {
            int pu = getParent(u);
            int pv = getParent(v);
            if (parents[pu] > parents[pv]) {
                int temp = pu;
                pu = pv;
                pv = temp;
            }

            parents[pu] += parents[pv];
            parents[pv] = pu;
        }

        private int getParent(int node) {
            if (parents[node] < 0)
                return node;
            return parents[node] = getParent(parents[node]);
        }

        private static class IntPair {
            private int first;
            private int second;

            private IntPair(int first, int second) {
                this.first = first;
                this.second = second;
            }


            public boolean equals(Object other) {
                TaskF.IntPair o = (TaskF.IntPair) other;
                return first == o.first && second == o.second;
            }


            public int hashCode() {
                return first + 31 * second;
            }

        }

        private class Node {
            private List<Node> adj;
            private int fromBelow;
            private int firstFromBelow;
            private int secondFromBelow;

            private Node() {
                adj = new ArrayList<>();
            }

            private void dfs0(Node parent) {
                fromBelow = 0;
                firstFromBelow = secondFromBelow = -INF;
                for (Node child : adj) {
                    if (child == parent) continue;
                    child.dfs0(this);
                    fromBelow = Math.max(fromBelow, 1 + child.fromBelow);
                    if (child.fromBelow > firstFromBelow) {
                        secondFromBelow = firstFromBelow;
                        firstFromBelow = child.fromBelow;
                    } else if (child.fromBelow > secondFromBelow) {
                        secondFromBelow = child.fromBelow;
                    }
                }
            }

            private int dfs1(Node parent, int fromTop, List<Integer> distances) {
                distances.add(Math.max(fromTop, fromBelow));
                int diameter = fromTop + fromBelow;
                for (Node child : adj) {
                    if (child == parent) continue;
                    int nextFromTop = fromTop + 1;
                    if (child.fromBelow == firstFromBelow)
                        nextFromTop = Math.max(nextFromTop, 2 + secondFromBelow);
                    else
                        nextFromTop = Math.max(nextFromTop, 2 + firstFromBelow);
                    diameter = Math.max(diameter, child.dfs1(this, nextFromTop, distances));
                }
                return diameter;
            }

        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        private static final int BUFFER_SIZE = 32768;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(
                    new InputStreamReader(stream), BUFFER_SIZE);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

