Problem: An undirected graph is given. Each edge of the graph disappears with a constant probability. Calculate the probability with which the remained graph is connected.



Input

The first line contains three integers N (1 \leq N \leq 14), M (0 \leq M \leq 100) and P (0 \leq P \leq 100), separated by a single space. N is the number of the vertices and M is the number of the edges. P is the probability represented by a percentage.

The following M lines describe the edges. Each line contains two integers v_i and u_i (1 \leq u_i, v_i \leq N). (u_i, v_i) indicates the edge that connects the two vertices u_i and v_i.

Output

Output a line containing the probability with which the remained graph is connected. Your program may output an arbitrary number of digits after the decimal point. However, the absolute error should be 10^{-9} or less.

Examples

Input

3 3 50
1 2
2 3
3 1


Output

0.500000000000


Input

3 3 10
1 2
2 3
3 1


Output

0.972000000000


Input

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


Output

0.437500000000

Solution (in CPP):

Solution:
#include <cstdio>
#include <cstdlib>
#include <cstring>

const int MAXN = 14;
const int MAXS = 1 << MAXN;

int n, m;
bool adj[MAXN][MAXN];
double p, f[MAXS];

int lowbit(int x) {

    return x & -x;
}

int main() {

    //freopen("in", "r", stdin);
    scanf("%d %d %lf", &n, &m, &p);
    p /= 100;
    int u, v;
    for (int i = 0; i < m; i++)
    {
        scanf("%d %d", &u, &v);
        u--, v--;
        adj[u][v] = adj[v][u] = true;
    }

    int range = 1 << n;
    for (int i = 0; i < range; i++)
    {
        if (!(i & (i - 1))) f[i] = 0;
        else
        {
            f[i] = 0;
            int t = i, cnt = 0;
            while (t) ++cnt, t -= lowbit(t);
            for (int j = 0; j < n; j++)
                if ((i >> j) & 1) { u = j; break; }
            int range_j = 1 << (cnt - 1);
            for (int j = 0; j < range_j - 1; j++)
            {
                t = i - lowbit(i);
                int subset = 0, lb;
                double val = 1;
                for (int k = 0; k < cnt - 1; k++)
                {
                    lb = lowbit(t);
                    if ((j >> k) & 1) subset |= lb;
                    t -= lb;
                }
                subset |= 1 << u;
                int not_subset = i ^ subset;
                for (int x = 0; x < n; x++)
                    if ((subset >> x) & 1)
                        for (int v = 0; v < n; v++)
                            if (((not_subset >> v) & 1) && adj[x][v]) val *=p;
                val *= 1 - f[subset];
                f[i] += val;
            }
          //  f[i] /= range_j;
        }
    }
/*
    for (int i = 0; i < range; i++)
    {
        printf("f[%d] = %lf\n", i, f[i]);
    }
    */
    printf("%.10f\n", 1 - f[range - 1]);

    return 0;
}