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.*;
import java.util.*;

public class D {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();

        n = sc.nextInt();
        int m = sc.nextInt();
        int q = sc.nextInt();
        forest = new List[n];
        for (int i = 0; i < n; i++) {
            forest[i] = new ArrayList<>();
        }
        ccRoots = new int[n]; // dfs1
        ccIds = new int[n]; // dfs1
        Arrays.fill(ccIds, -1);
        distToRoot = new int[n]; // dfs1
        ccSums = new long[n]; // Compute after centroid decomposition
        ccSizes = new int[n]; // dfs1
        furthestFrom = new long[n];
        componentDiameters = new long[n];
        for (int i = 0; i < m; i++) {
            int u = sc.nextInt() - 1;
            int v = sc.nextInt() - 1;
            forest[u].add(v);
            forest[v].add(u);
        }

        for (int i = 0; i < n; i++) {
            if (ccIds[i] == -1) {
                dfs1(i, numCcs, 0, i, i);
                numCcs++;
            }
        }

        CentroidDecomposition centroidDecomposition = new CentroidDecomposition(forest);
        for (int i = 0; i < n; i++) {
            if (distToRoot[i] == 0) { // is root
                centroidDecomposition.decompose(i);
            }
        }

        for (int i = 0; i < n; i++) {
            ccSums[ccIds[i]] += furthestFrom[i];
            ccSizes[ccIds[i]]++;
            componentDiameters[ccIds[i]] = Math.max(componentDiameters[ccIds[i]], furthestFrom[i]);
        }

        sortedFurthestFroms = new List[numCcs];
        sortedFurthestFromsPrefixSums = new long[numCcs][];
        for (int cc = 0; cc < numCcs; cc++) {
            sortedFurthestFroms[cc] = new ArrayList<>();
            sortedFurthestFromsPrefixSums[cc] = new long[ccSizes[cc]];
        }
        for (int i = 0; i < n; i++) {
            sortedFurthestFroms[ccIds[i]].add(furthestFrom[i]);
        }
        for (int cc = 0; cc < numCcs; cc++) {
            Collections.sort(sortedFurthestFroms[cc]);
            sortedFurthestFromsPrefixSums[cc][0] = sortedFurthestFroms[cc].get(0);
            for (int i = 1; i < ccSizes[cc]; i++) {
                sortedFurthestFromsPrefixSums[cc][i] = sortedFurthestFromsPrefixSums[cc][i - 1]
                        + sortedFurthestFroms[cc].get(i);
            }
        }

        cache = new HashMap<>();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < q; i++) {
            int u = sc.nextInt() - 1;
            int v = sc.nextInt() - 1;
            int ucc = ccIds[u];
            int vcc = ccIds[v];
            if (ucc == vcc) {
                sb.append(-1);
            } else {
                double ans = eval(ucc, vcc);
                sb.append(ans);
            }
            sb.append('\n');
        }
        System.out.print(sb);
    }

    static void dfs1(int u, int cc, int depth, int root, int parent) {
        ccRoots[u] = root;
        ccIds[u] = cc;
        distToRoot[u] = depth;
        for (int v : forest[u]) {
            if (v != parent) {
                dfs1(v, cc, depth + 1, root, u);
            }
        }
    }

    static long rangeSum(long[] prefixSums, int l, int r) {
        if (l > r) {
            return 0;
        }
        long sum = prefixSums[r];
        if (l > 0) {
            sum -= prefixSums[l - 1];
        }
        return sum;
    }

    static List<Long>[] sortedFurthestFroms;
    static long[][] sortedFurthestFromsPrefixSums;
    static Map<Pair, Double> cache;
    static double eval(int cc1, int cc2) {
        if (cc1 == cc2) {
            return -1;
        }
        if (ccSizes[cc1] > ccSizes[cc2]) {
            int tmp = cc1;
            cc1 = cc2;
            cc2 = tmp;
        }
        Pair pair = new Pair(cc1, cc2);
        if (cache.containsKey(pair)) {
            return cache.get(pair);
        }

        long top = 0;
        // size1 <= size2
        long size1 = ccSizes[cc1];
        long size2 = ccSizes[cc2];
        long maxDiameter = Math.max(componentDiameters[cc1], componentDiameters[cc2]);

        for (int i = 0; i < size1; i++) {
            int low = -1;
            int high = (int) size2 - 1;
            while (low < high) {
                int mid = (low + high + 1) / 2;
                long sum = sortedFurthestFroms[cc1].get(i) + 1 + sortedFurthestFroms[cc2].get(mid);
                if (sum <= maxDiameter) {
                    low = mid;
                } else {
                    high = mid - 1;
                }
            }
            long add = 0;
            add += (low + 1) * maxDiameter;
            add += rangeSum(sortedFurthestFromsPrefixSums[cc2], low + 1, (int) size2 - 1)
                    + (size2 - low - 1) * (sortedFurthestFroms[cc1].get(i) + 1);
            top += add;
        }

        double bot = size1 * size2;
        double ans = top / bot;
        cache.put(pair, ans);
        return ans;
    }

    public static class CentroidDecomposition {
        List<Integer>[] adj;
        boolean[] blocked;
        int[] parents, sizes;

        CentroidDecomposition(List<Integer>[] tree) {
            adj = tree;
            blocked = new boolean[adj.length];
            parents = new int[adj.length];
            sizes = new int[adj.length];
//            decompose(0);
        }

        void decompose(int root) {
            dfsSize(root, -1);

            // Find centroid
            int centroid = root;
            int minMaxSubtreeSize = sizes[root];
            Queue<Integer> bfs = new ArrayDeque<>();
            bfs.offer(root);
            while (!bfs.isEmpty()) {
                int u = bfs.poll();
                int maxSubtreeSize = sizes[root] - sizes[u];
                for (int v : adj[u]) {
                    if (v != parents[u] && !blocked[v]) {
                        maxSubtreeSize = Math.max(maxSubtreeSize, sizes[v]);
                        bfs.offer(v);
                    }
                }
                if (maxSubtreeSize < minMaxSubtreeSize) {
                    minMaxSubtreeSize = maxSubtreeSize;
                    centroid = u;
                }
            }

            solveSubtree(centroid, sizes[root]); // Solve entire subtree

            blocked[centroid] = true;
            for (int v : adj[centroid])
                if (!blocked[v])
                    decompose(v); // Solve with centroid deleted
        }

        void dfsSize(int u, int parent) {
            parents[u] = parent;
            sizes[u] = 1;
            for (int v : adj[u]) {
                if (v != parent && !blocked[v]) {
                    dfsSize(v, u);
                    sizes[u] += sizes[v];
                }
            }
        }

        void solveSubtree(int root, int subtreeSize) {
            int numSubtrees = 0;
            for (int v : adj[root]) {
                if (!blocked[v]) {
                    numSubtrees++;
                }
            }
            Subtree[] subtrees = new Subtree[numSubtrees];
            int idx = 0;
            for (int v : adj[root]) {
                if (!blocked[v]) {
                    int maxDepth = dfsDepth(v, root, 1);
                    subtrees[idx] = new Subtree(v, maxDepth);
                    idx++;
                }
            }

            if (numSubtrees == 0) {
//                furthestFrom[root] = Math.max()
            } else {
                Arrays.sort(subtrees);
                furthestFrom[root] = Math.max(furthestFrom[root], subtrees[0].maxDepth);
                for (Subtree subtree : subtrees) {
                    if (subtree == subtrees[0]) {
                        if (numSubtrees > 1) {
                            int otherDepth = subtrees[1].maxDepth;
                            dfsDepth2(subtree.root, root, 1, otherDepth);
                        } else {
                            int otherDepth = 0;
                            dfsDepth2(subtree.root, root, 1, otherDepth);
                        }
                    } else {
                        int otherDepth = subtrees[0].maxDepth;
                        dfsDepth2(subtree.root, root, 1, otherDepth);
                    }
                }
            }
        }

        int dfsDepth(int u, int parent, int depth) {
            int max = depth;
            for (int v : adj[u]) {
                if (v != parent && !blocked[v]) {
                    int x = dfsDepth(v, u, depth + 1);
                    max = Math.max(max, x);
                }
            }
            return max;
        }

        void dfsDepth2(int u, int parent, int depth, int otherDepth) {
            furthestFrom[u] = Math.max(furthestFrom[u], depth + otherDepth);
            for (int v : adj[u]) {
                if (v != parent && !blocked[v]) {
                    dfsDepth2(v, u, depth + 1, otherDepth);
                }
            }
        }
    }

    static class Pair {
        final int u, v;

        public Pair(int u, int v) {
//            this.u = Math.min(u, v);
//            this.v = Math.max(u, v);
            this.u = u;
            this.v = v;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            if (u != pair.u) return false;
            return v == pair.v;

        }

        @Override
        public int hashCode() {
            long result = u;
            result = 100000 * result + v;
            return Long.hashCode(result);
        }
    }

    static class Subtree implements Comparable<Subtree> {
        final int root;
        final int maxDepth;

        public Subtree(int root, int maxDepth) {
            this.root = root;
            this.maxDepth = maxDepth;
        }

        @Override
        public int compareTo(Subtree o) {
            return -Integer.compare(maxDepth, o.maxDepth);
        }
    }

    static int n;
    static List<Integer>[] forest;
    static int[] distToRoot;

    static int[] ccIds;
    static int numCcs;
    static int[] ccRoots;
    static long[] ccSums;
    static int[] ccSizes;
    static long[] furthestFrom;
    static long[] componentDiameters;

    static void sort(long[] arr) {
        Random rng = new Random();
        int length = arr.length;
        for (int idx = 0; idx < arr.length; idx++) {
            int toSwap = idx + rng.nextInt(length-idx);
            long tmp = arr[idx];
            arr[idx] = arr[toSwap];
            arr[toSwap] = tmp;
        }
        Arrays.sort(arr);
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextLong();
            }
            return a;
        }
    }
}
