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 <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <functional>
#include <set>
#include <ctime>
#include <random>
#include <bitset>
using namespace std;

class UnionFindTree{
	typedef struct {
		int parent;
		int rank;
	}base_node;
	
	vector<base_node> node;
public:
	UnionFindTree(int n){
		node.resize(n);
		for(int i=0; i<n; i++){
			node[i].parent=i;
			node[i].rank=0;
		}
	}

	int find(int x){
		if(node[x].parent == x) return x;
		else{
			return node[x].parent = find(node[x].parent);
		}
	}
	
	bool same(int x, int y){
		return find(x) == find(y);
	}

	void unite(int x, int y){
		x = find(node[x].parent);
		y = find(node[y].parent);
		if(x==y) return;
		if(node[x].rank < node[y].rank){
			node[x].parent = y;
		}else if(node[x].rank > node[y].rank){
			node[y].parent = x;
		}else{
			node[x].rank++;
			unite(x,y);
		}
	}
};

int main_(){
	int n,m,p;
	cin >> n >> m >> p;

	UnionFindTree uft(n);

	vector<int> u(m),v(m);
	vector<int> e(m);
	vector<vector<int>> g(n);
	//vector<int> g(n);
	for(int i=0; i<m; i++){
		cin >> u[i] >> v[i];
		u[i]--; v[i]--;
		//g[u[i]] |= 1<<v[i];
		//g[v[i]] |= 1<<u[i];
		g[u[i]].push_back(v[i]);
		g[v[i]].push_back(u[i]);
		//e[i] = (1<<u[i]) | (1<<v[i]);
		uft.unite(u[i], v[i]);
	}
	bool connected = true;
	for(int i=1; i<n; i++){
		connected = connected && uft.same(0,i);
	}
	if(connected == false){
		printf("0.000000000000000000\n");
		return 0;
	}

	vector<int> edge_cnt(1<<n, 0);
	for(int i=0; i<(1<<n); i++){
		for(int j=0; j<m; j++){
			if((i>>u[j])&(i>>v[j])&1){
				edge_cnt[i]++;
			}
		}
	}

	vector<double> prob(1<<n, -1);
	prob[1] = 1;

	function<double(int)> dfs = [&](int s){
		if(prob[s] != -1) return prob[s];
		double res = 1.0;
		int s_ = s-1;
		for(int x=s_; x>=0; x=(x-1)&s_){
			int y = x|1;
			if(y==s) continue;
			double q = dfs(y);
			if(q<1e-13) continue;
			double tmp = 1.0;
			/*
			for(int i=0; i<m; i++){
				if( (((1<<u[i])&y) && ((1<<v[i])&(s^y))) or (((1<<v[i])&y) and ((1<<u[i])&(s^y))) ){
					tmp *= 0.01 * p;
				}
			}
			*/
			
			tmp = pow(0.01*p, edge_cnt[s] - edge_cnt[y] - edge_cnt[s^y]);

			res -= q * tmp;

			if(x==0) break;
		}
		return prob[s] = res;
	};

	double ans = dfs((1<<n)-1);
	printf("%.18f\n", ans);
	return 0;
}


int main(){
	auto start = clock();
	main_();
	//cerr << clock()-start << endl;
	return 0;
}