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<iostream>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
double dp[100010];
int N,M;
double p;
int g[20][20];
#define eps 1e-6
bool jud[20];
void dfs(int n)
{
    jud[n]=true;
    for(int i=0;i<N;i++)
    {
        if(g[n][i]&&!jud[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    int i,j,k;
    int n,m,t;
    int a,b,s;
    scanf("%d%d%lf",&N,&M,&p);
    for(i=0;i<M;i++)
    {
        scanf("%d%d",&a,&b);
        a--;b--;
        if(a==b)
        {
            i--;M--;
            continue;
        }
        g[a][b]=g[b][a]=1;
    }
    p/=100.0;
    if(p<eps)
    {
        dfs(0);
        for(i=0;i<N;i++) if(!jud[i]) break;
        if(i==N) printf("1.000000000000\n");
        else printf("0.000000000000\n");
        return 0;
    }

    if(p>1.0-eps)
    {
        if(N>1) printf("0.000000000000\n");
        else printf("1.000000000000\n");
        return 0;
    }

    for(i=0;i<N;i++) dp[(1<<i)]=1.0;
    double pp;
    for(n=1;n<(1<<N);n++)
    {
        //cout<<n<<endl;
        for(i=0;i<N;i++) if(n==(1<<i)) break;
        if(i<N) continue;
        for(a=0;a<N;a++) if(n&(1<<a)) break;
        for(b=0;b<N;b++) if((n&(1<<b))&&b!=a) break;
        for(m=n&(n-1);m;m=n&(m-1))
        {
            if(m&(1<<a)) continue;
            if(!(m&(1<<b))) continue;
            t=n&(~m);pp=1.0;
            for(i=0;i<N;i++)
                if(((1<<i)&m)&&g[a][i]) pp*=p;
            pp=1.0/pp-1.0;
            dp[n]+=dp[m]*dp[t]*pp;
            //cout<<n<<"  "<<m<<"   "<<dp[n]<<endl;
        }
        //cout<<n<<"  "<<dp[n]<<endl;
    }
    for(i=0;i<M;i++) dp[(1<<N)-1]*=p;
    printf("%.12f\n",dp[(1<<N)-1]);
    return 0;
}