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<bits/stdc++.h>
using namespace std;
using ld=double;

int n,m;
ld p;
using Edge=int;
using Edges=vector<Edge>;
using Graph=vector<Edges>;
Graph g;
int tpow[15];
array<ld,15000000> table;
array<ld,1000000> dp;
ld solve(int st);
ld dfs(int inde,int mc,int st,int stt,array<int,14>& sts,array<int,14> &sttv){
    if(inde==n){
        if(mc==1) return 0;
        ld res=1.0;
        for(int i=0;i<mc;i++){
            if(i==0) res*=solve(sts[i])*table[sttv[i]+stt];
        }
        return res;
    }
    if(!((st>>inde)&1)) return dfs(inde+1,mc,st,stt,sts,sttv);
    ld res=0;
    
    for(int i=0;i<mc;i++){
        sts[i]|=(1<<inde);
        sttv[i]+=tpow[inde];
        res+=dfs(inde+1,mc,st,stt,sts,sttv);
        sttv[i]-=tpow[inde];
        sts[i]^=(1<<inde);
    }
    if(mc<=1){
    sts[mc]=(1<<inde);
    sttv[mc]+=tpow[inde];
    res+=dfs(inde+1,mc+1,st,stt,sts,sttv);
    
    sttv[mc]=0;
    sts[mc]=0;
    }
    return res;
}
ld solve(int st){
    if(dp[st]>-0.5) return dp[st];
    if(__builtin_popcount(st)<=1) return dp[st]=1.0;
    int stt=0;
    for(int i=0;i<n;i++){
        if((st>>i)&1) stt+=tpow[i];
    }
    array<int,14> sts;
    fill(sts.begin(),sts.end(),0);
    array<int,14> sttv;
    fill(sttv.begin(),sttv.end(),0);
    ld res=1.0-dfs(0,0,st,stt,sts,sttv);
    return dp[st]=res;
}
int main(){
    tpow[0]=1;
    for(int i=0;i<14;i++) tpow[i+1]=tpow[i]*3;
    fill(dp.begin(),dp.end(),-1);
    cin>>n>>m>>p;
    p/=100.;
    g.assign(n,Edges());
    for(int i=0;i<m;i++){
        int u,v;
        cin>>u>>v;
        u--,v--;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    
    for(int i=0;i<(1<<n);i++){
        int sub=i;
        int it=0;
        for(int k=0;k<n;k++){
            if((i>>k)&1){
                it+=tpow[k];
            }
        }
        do{
            ld pc=1;
            for(int j=0;j<n;j++){
                if((sub>>j)&1){
                    for(int k=0;k<g[j].size();k++){
                        if(((i>>g[j][k])&1)&&(!((sub>>g[j][k])&1))){
                            pc*=p;
                        }
                    }
                }
            }
            int subt=0;
            for(int k=0;k<n;k++){
                if((sub>>k)&1){
                    subt+=tpow[k];
                }
            }
            table[it+subt]=pc;
            sub=(sub-1)&i;
        }while(sub!=i);
    }
    cout<<setprecision(15)<<fixed;
    cout<<solve((1<<n)-1)<<endl;
    return 0;
}