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 <cmath>
#include <cstring>

const int maxm=200;

int n,m,u,v;
double p;
int begin[14],end[maxm],next[maxm],k;
double dp[1<<14],x;
int maxn;
bool vis[1<<14];
bool dis[14][14];

double dfs(int s)
{
    if(vis[s])return dp[s];
    vis[s]=1;
    dp[s]=0;
    for(int i=(s-1)&s;i;i=(i-1)&s)
    {
        if((i&(-i))!=(s&(-s)))continue;
        double x=1;
        for(u=0;u<n;u++)
            if(i&(1<<u))
            {
                for(v=0;v<n;v++)
                {
                    if(!dis[u][v])continue;
                    if((1<<v)&(s^i))
                    {
                        x=x*p;
                    }
                }
            }
        dp[s]+=dfs(i)*x;
        //printf("%d,%d:%.10f %.10f\n",s,i,x,dp[s]);
    }
    //printf("%d:%.10f\n",s,dp[s]);
    dp[s]=1-dp[s];
    return dp[s];
}

void insert(const int &u,const int &v)
{
    end[k]=v;
    next[k]=begin[u];
    begin[u]=k++;
}

int main()
{
    while(scanf("%d%d%lf",&n,&m,&p)==3)
    {
        memset(begin,-1,sizeof(begin));
        p=p/100.0;
        maxn=(1<<n);
        for(int i=0;i<maxn;i++)
            dp[i]=0.0;
        k=0;
        memset(dis,0,sizeof(dis));
        for(int i=0;i<m;i++)
        {
            scanf("%d%d",&u,&v);
            u--;
            v--;
            dis[u][v]=dis[v][u]=1;
            insert(u,v);
            insert(v,u);
        }
        memset(vis,0,sizeof(vis));
        for(int i=0;i<n;i++)
            dp[1<<i]=1.0,vis[1<<i]=1;
        printf("%.10f\n",dfs(maxn-1));
    }
    return 0;
}