#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

inline unsigned nextSubset(unsigned S, unsigned U)
{
  return (S - U) & U;
}

int n, m, p;
int g[100][100];
double memo[1 << 14];
int cnt[1 << 14];
double P[200];

double calc(int use) {
  assert(use != 0);
  if (!isnan(memo[use])) { return memo[use]; }
  double ret = 1;
  for (int divide = use & -use; divide != use; divide = nextSubset(divide, use)) {
    if ((divide & 1) != 1) { continue; }
    int c = cnt[divide] + cnt[use ^ divide] - cnt[((1 << n) - 1) ^ use];
    c /= 2;
    ret -= calc(divide) * P[c];
  }
  //cout << use << " " << ret << endl;
  return memo[use] = ret;
}

int main() {
  while (scanf("%d %d %d", &n, &m, &p) > 0) {
    P[0] = 1.0;
    REP(i, 110) { P[i + 1] = P[i] * p / 100.0; }
    MEMSET(memo, -1);
    MEMSET(g, 0);
    MEMSET(cnt, 0);
    REP(i, m) {
      int f, t;
      scanf("%d %d", &f, &t);
      f--; t--;
      g[f][t]++; g[t][f]++;
    }
    REP(use, 1 << n) {
      REP(f, n) {
        if (!((use >> f) & 1)) { continue; }
        REP(t, n) {
          if ((use >> t) & 1) { continue; }
          cnt[use] += g[f][t];
        }
      }
    }
    double ans = calc((1 << n) - 1);
    printf("%.10f\n", ans);
  }
}
### Prompt

Construct a CPP code solution to the problem outlined:

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

### Response

```cpp
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

inline unsigned nextSubset(unsigned S, unsigned U)
{
  return (S - U) & U;
}

int n, m, p;
int g[100][100];
double memo[1 << 14];
int cnt[1 << 14];
double P[200];

double calc(int use) {
  assert(use != 0);
  if (!isnan(memo[use])) { return memo[use]; }
  double ret = 1;
  for (int divide = use & -use; divide != use; divide = nextSubset(divide, use)) {
    if ((divide & 1) != 1) { continue; }
    int c = cnt[divide] + cnt[use ^ divide] - cnt[((1 << n) - 1) ^ use];
    c /= 2;
    ret -= calc(divide) * P[c];
  }
  //cout << use << " " << ret << endl;
  return memo[use] = ret;
}

int main() {
  while (scanf("%d %d %d", &n, &m, &p) > 0) {
    P[0] = 1.0;
    REP(i, 110) { P[i + 1] = P[i] * p / 100.0; }
    MEMSET(memo, -1);
    MEMSET(g, 0);
    MEMSET(cnt, 0);
    REP(i, m) {
      int f, t;
      scanf("%d %d", &f, &t);
      f--; t--;
      g[f][t]++; g[t][f]++;
    }
    REP(use, 1 << n) {
      REP(f, n) {
        if (!((use >> f) & 1)) { continue; }
        REP(t, n) {
          if ((use >> t) & 1) { continue; }
          cnt[use] += g[f][t];
        }
      }
    }
    double ans = calc((1 << n) - 1);
    printf("%.10f\n", ans);
  }
}
```