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.util.Arrays;
import java.util.HashMap;
import java.util.ArrayList;
import java.math.BigDecimal;
import java.util.Map;
import java.io.OutputStreamWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.List;
import java.io.Closeable;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            DExpectedDiameterOfATree solver = new DExpectedDiameterOfATree();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class DExpectedDiameterOfATree {
        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.readInt();
            int m = in.readInt();
            int q = in.readInt();

            Node[] nodes = new Node[n];
            for (int i = 0; i < n; i++) {
                nodes[i] = new Node();
                nodes[i].id = i;
            }

            for (int i = 0; i < m; i++) {
                Node a = nodes[in.readInt() - 1];
                Node b = nodes[in.readInt() - 1];
                a.adj.add(b);
                b.adj.add(a);
            }

            for (Node node : nodes) {
                if (node.top == null) {
                    dfsForDiameter(node, null, 0, node);
                    node.depthCnt = new int[node.size];
                    node.suffix = new int[node.size];
                    node.suffixSum = new long[node.size];
                    findDepth(node, null, 0);
                    for (int i = node.size - 1; i >= 0; i--) {
                        node.suffix[i] = node.depthCnt[i];
                        node.suffixSum[i] = (long) node.depthCnt[i] * i;
                        if (i + 1 < node.size) {
                            node.suffix[i] += node.suffix[i + 1];
                            node.suffixSum[i] += node.suffixSum[i + 1];
                        }
                    }
                }
            }

            Map<Long, Double> cache = new HashMap<>(q);
            for (int i = 0; i < q; i++) {
                Node a = nodes[in.readInt() - 1].top;
                Node b = nodes[in.readInt() - 1].top;
                if (a == b) {
                    out.println(-1);
                    continue;
                }
                if (a.size > b.size || (a.size == b.size && a.id > b.id)) {
                    Node tmp = a;
                    a = b;
                    b = tmp;
                }
                long key = DigitUtils.asLong(a.id, b.id);
                if (cache.containsKey(key)) {
                    out.println(cache.get(key));
                    continue;
                }
                long total = (long) a.size * b.size;
                long way = 0;
                long sum = 0;
                int diameter = Math.max(a.diameter, b.diameter);
                for (int j = 0; j < a.size; j++) {
                    int k = Math.max(0, diameter + 1 - 1 - j);
                    if (k >= b.size) {
                        continue;
                    }
                    way += b.suffix[k] * a.depthCnt[j];
                    sum += a.depthCnt[j] * (b.suffixSum[k] + b.suffix[k] * (long) (j + 1));
                }

                sum += (total - way) * diameter;
                double ans = (double) sum / total;
                out.println(ans);
                cache.put(key, ans);
            }
        }

        public void dfsForDiameter(Node root, Node p, int depth, Node top) {
            root.depth = depth;
            root.farthest = root.depth;
            root.top = top;
            root.size = 1;
            for (Node node : root.adj) {
                if (node == p) {
                    continue;
                }
                dfsForDiameter(node, root, depth + 1, top);
                root.size += node.size;
                root.diameter = Math.max(root.diameter, node.diameter);
                root.diameter = Math.max(root.diameter, root.farthest + node.farthest - 2 * root.depth);
                root.farthest = Math.max(root.farthest, node.farthest);
            }
        }

        public void findDepth(Node root, Node p, int height) {
            root.height = Math.max(height, root.farthest - root.depth);
            root.top.depthCnt[root.height]++;

            int[] max = new int[2];
            Arrays.fill(max, root.depth);
            for (Node node : root.adj) {
                if (node == p) {
                    continue;
                }
                if (max[0] >= node.farthest) {
                    continue;
                }
                max[0] = node.farthest;
                if (max[0] > max[1]) {
                    SequenceUtils.swap(max, 0, 1);
                }
            }
            for (Node node : root.adj) {
                if (node == p) {
                    continue;
                }
                int h = height;
                int cand = max[1] == node.farthest ? max[0] : max[1];
                h = Math.max(h, cand - root.depth) + 1;
                findDepth(node, root, h);
            }
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(double c) {
            cache.append(new BigDecimal(c).toPlainString());
            return this;
        }

        public FastOutput append(Object c) {
            cache.append(c);
            return this;
        }

        public FastOutput println(int c) {
            return append(c).println();
        }

        public FastOutput println(double c) {
            return append(c).println();
        }

        public FastOutput println(Object c) {
            return append(c).println();
        }

        public FastOutput println() {
            cache.append(System.lineSeparator());
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class DigitUtils {
        private static long LONG_TO_INT_MASK = (1L << 32) - 1;

        private DigitUtils() {
        }

        public static long asLong(int high, int low) {
            return (((long) high) << 32) | (((long) low) & LONG_TO_INT_MASK);
        }

    }

    static class Node {
        List<Node> adj = new ArrayList<>();
        Node top;
        int depth;
        int id;
        int height;
        int size;
        int[] depthCnt;
        int[] suffix;
        long[] suffixSum;
        int diameter;
        int farthest;

    }

    static class SequenceUtils {
        public static void swap(int[] data, int i, int j) {
            int tmp = data[i];
            data[i] = data[j];
            data[j] = tmp;
        }

    }
}

