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>.
/**
 * author: derrick20
 * created: 1/1/21 7:44 PM
 */
import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class ExpectedDiameter {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        int Q = sc.nextInt();
        adjList = new ArrayList[N];
        Arrays.setAll(adjList, i -> new ArrayList<>());
        id = new int[N];
        sz = new int[N];
        Arrays.setAll(id, i -> i);
        for (int i = 0; i < M; i++) {
            int u = sc.nextInt() - 1;
            int v = sc.nextInt() - 1;
            adjList[u].add(v);
            adjList[v].add(u);
            unite(u, v);
        }

        vis = new boolean[N];
        dpDown = new int[N][2];
        dpChild = new int[N][2];
        dpUp = new int[N];
        distSuffix = new long[N][];
        freqSuffix = new int[N][];
        diameter = new int[N];
        ArrayDeque<Integer> roots = new ArrayDeque<>();
        for (int u = 0; u < N; u++) {
            int root = find(u);
            if (!vis[root]) {
                vis[root] = true;
                roots.add(root);
                solveDown(u, -1);
                ArrayList<Integer> dists = new ArrayList<>();
                solveUp(u, -1, dists);

                dists.sort(Collections.reverseOrder());
//                System.out.println("At root = " + root + " Found dists of " + dists);
                int diam = dists.get(0);
                diameter[root] = diam;
                distSuffix[root] = new long[diam + 2];
                freqSuffix[root] = new int[diam + 2];
                for (int d : dists) {
                    distSuffix[root][d] += d;
                    freqSuffix[root][d]++;
                }
                for (int i = diam; i >= 0; i--) {
                    distSuffix[root][i] += distSuffix[root][i + 1];
                    freqSuffix[root][i] += freqSuffix[root][i + 1];
                }
            }
        }
        int SQRT = (int) sqrt(N);
        ArrayDeque<Integer> bigTrees = new ArrayDeque<>();
        for (int root : roots) {
            if (diameter[root] >= SQRT) {
                bigTrees.add(root);
            }
        }

        HashMap<Pair, Double> bigPairs = new HashMap<>();
        for (int root1 : bigTrees) {
            for (int root2 : bigTrees) {
                if (root2 > root1) {
                    double EV = solve(root1, root2);
                    bigPairs.put(new Pair(root1, root2), EV);
                }
            }
        }
        while (Q-->0) {
            int u = find(sc.nextInt() - 1);
            int v = find(sc.nextInt() - 1);
            if (u == v) {
                out.println(-1);
            } else {
                double EV = bigPairs.getOrDefault(new Pair(u, v), -1.0);
                if (EV == -1) {
                    EV = solve(u, v);
                }
                out.println(EV);
            }
        }
        out.close();
    }

    static int[] id, sz;
    static ArrayList<Integer>[] adjList;
    static boolean[] vis;
    static int[] dpUp;
    static int[][] dpDown, dpChild;
    static long[][] distSuffix;
    static int[][] freqSuffix;
    static int[] diameter;

    static class Pair {
        int u, v;
        public Pair(int uu, int vv) {
            u = uu; v = vv;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair pair = (Pair) o;
            return u == pair.u && v == pair.v;
        }

        @Override
        public int hashCode() {
            return Objects.hash(u, v);
        }
    }

    static double solve(int root1, int root2) {
        if (diameter[root1] > diameter[root2]) {
//            root1 ^= ((root2 = root1) ^ root2);
            int temp = root1;
            root1 = root2;
            root2 = temp;
        }
        int D1 = diameter[root1];
        int D2 = diameter[root2];
        long totalSum = 0;
        long biggerPairs = 0;
        for (int d1 = 0, d2 = D2; d1 <= D1; d1++, d2--) {
            long f1 = freqSuffix[root1][d1] - freqSuffix[root1][d1 + 1];
            long freqSum = freqSuffix[root2][d2];
            long distSum = distSuffix[root2][d2];
//            System.out.println("Contributing f1 = " + f1 + " at d1 = " + d1);
            totalSum += f1 * ((d1 + 1) * freqSum + distSum);
            biggerPairs += f1 * freqSum;
        }
        long s1 = freqSuffix[root1][0];
        long s2 = freqSuffix[root2][0];
        long constantPairs = s1 * s2 - biggerPairs;
//        System.out.println("Constant = " + constantPairs);
//        System.out.println("Bigger pairs = " + biggerPairs + " yields " + totalSum);
        double EV = (double) (constantPairs * D2 + totalSum) / (s1 * s2);
        return EV;
    }

    static void solveUp(int node, int par, ArrayList<Integer> dists) {
        int maxDist = max(dpDown[node][0], dpUp[node]);
//        System.out.println("At node = " + node + " poss = " + dpDown[node][0] + " " + dpUp[node]);
        dists.add(maxDist);
        for (int adj : adjList[node]) {
            if (adj != par) {
                if (dpChild[node][0] != adj) {
                     dpUp[adj] = 1 + max(dpUp[node], dpDown[node][0]);
                 } else {
                     dpUp[adj] = 1 + max(dpUp[node], dpDown[node][1]);
                 }
                solveUp(adj, node, dists);
            }
        }
    }

    static void solveDown(int node, int par) {
        for (int adj : adjList[node]) {
            if (adj != par) {
                solveDown(adj, node);
                int dist = 1 + dpDown[adj][0];
                if (dist >= dpDown[node][0]) {
                    dpDown[node][1] = dpDown[node][0];
                    dpChild[node][1] = dpChild[node][0];
                    dpDown[node][0] = dist;
                    dpChild[node][0] = adj;
                } else if (dist > dpDown[node][1]) {
                    dpDown[node][1] = dist;
                    dpChild[node][1] = adj;
                }
            }
        }
    }

    static int find(int u) {
        return id[u] == u ? u : (id[u] = find(id[u]));
    }

    static void unite(int u, int v) {
        if ((u = find(u)) != (v = find(v))) {
            id[v] = u;
            sz[u] += sz[v];
        }
    }

    static class FastScanner {
        private int BS = 1 << 16;
        private char NC = (char) 0;
        private byte[] buf = new byte[BS];
        private int bId = 0, size = 0;
        private char c = NC;
        private double cnt = 1;
        private BufferedInputStream in;
    
        public FastScanner() {
            in = new BufferedInputStream(System.in, BS);
        }
    
        public FastScanner(String s) {
            try {
                in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
            } catch (Exception e) {
                in = new BufferedInputStream(System.in, BS);
            }
        }
    
        char getChar() {
            while (bId == size) {
                try {
                    size = in.read(buf);
                } catch (Exception e) {
                    return NC;
                }
                if (size == -1) return NC;
                bId = 0;
            }
            return (char) buf[bId++];
        }
    
        int nextInt() {
            return (int) nextLong();
        }
    
        long nextLong() {
            cnt = 1;
            boolean neg = false;
            if (c == NC) c = getChar();
            for (; (c < '0' || c > '9'); c = getChar()) {
                if (c == '-') neg = true;
            }
            long res = 0;
            for (; c >= '0' && c <= '9'; c = getChar()) {
                res = (res << 3) + (res << 1) + c - '0';
                cnt *= 10;
            }
            return neg ? -res : res;
        }
    
        double nextDouble() {
            boolean neg = false;
            if (c == NC) c = getChar();
            for (; (c < '0' || c > '9'); c = getChar()) {
                if (c == '-') neg = true;
            }
            double cur = nextLong();
            if (c != '.') {
                return neg ? -cur : cur;
            } else {
                double frac = nextLong() / cnt;
                return neg ? -cur - frac : cur + frac;
            }
        }
    
        String next() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c > 32) {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }
    
        String nextLine() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c != '\n') {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }
    
        boolean hasNext() {
            if (c > 32) return true;
            while (true) {
                c = getChar();
                if (c == NC) return false;
                else if (c > 32) return true;
            }
        }
    }
    static void ASSERT(boolean assertion, String message) {
        if (!assertion) throw new AssertionError(message);
    }
    static void ASSERT(boolean assertion) {
        if (!assertion) throw new AssertionError();
    }
}