#include <bits/stdc++.h>
using namespace std;
const int maxn = 508;
const int maxm = 108;
void inverse(int n, double A[maxn][maxn], double B[maxn][maxn]) {
  static double tmp[maxn][maxn * 2];
  memset(tmp, 0, sizeof(tmp));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      tmp[i][j] = A[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    tmp[i][i + n] = 1.0;
  }
  for (int i = 1; i <= n; i++) {
    int pos = -1;
    double v = 0.0;
    for (int j = i; j <= n; j++) {
      if (fabs(tmp[j][i]) > fabs(v) + 1e-9) {
        v = tmp[j][i];
        pos = j;
      }
    }
    if (pos == -1) continue;
    for (int k = 1; k <= n * 2; k++) swap(tmp[pos][k], tmp[i][k]);
    for (int k = 1; k <= n * 2; k++) tmp[i][k] /= v;
    for (int j = 1; j <= n; j++)
      if (j != i) {
        v = tmp[j][i];
        for (int k = 1; k <= n * 2; k++) {
          tmp[j][k] -= v * tmp[i][k];
        }
      }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      B[i][j] = tmp[i][n + j];
    }
  }
}
int G[maxn][maxn];
int deg[maxn];
int trap[maxn];
double P[maxn][maxn];
inline void print(int n, double A[][maxn]) {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n + 1; j++) {
      printf("%5.2f ", A[i][j]);
    }
    printf("\n");
  }
}
double Y[maxn];
double W[maxm][maxm];
int f[maxn], invf[maxn];
inline void multi(int n, double a[maxm][maxm], double b[maxm][maxm],
                  double res[maxm][maxm]) {
  static double tmp[maxm][maxm];
  memset(tmp, 0, sizeof(tmp));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= n; k++) {
        tmp[i][j] += a[i][k] * b[k][j];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      res[i][j] = tmp[i][j];
    }
  }
}
inline void qpow(int n, double a[maxm][maxm], int k, double res[maxm][maxm]) {
  static double tmp[maxm][maxm];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      tmp[i][j] = 0.0;
      if (i == j) {
        tmp[i][j] = 1.0;
      }
    }
  }
  for (; k; k >>= 1) {
    if (k & 1) {
      multi(n, a, tmp, tmp);
    }
    multi(n, a, a, a);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      res[i][j] = tmp[i][j];
    }
  }
}
int main() {
  int N, M, K;
  scanf("%d%d%d", &N, &M, &K);
  for (int i = 1; i <= N; i++) {
    scanf("%d", trap + i);
  }
  memset(G, 0, sizeof(G));
  for (int i = 0; i < M; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    G[x][y]++;
    G[y][x]++;
    deg[x]++;
    deg[y]++;
  }
  memset(P, 0, sizeof(P));
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      if (!trap[j]) {
        P[i][j] += (double)G[i][j] / (double)deg[i];
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    P[i][i] -= 1.0;
  }
  inverse(N, P, P);
  int tot = 0;
  for (int i = 1; i <= N; i++) {
    if (trap[i] || i == 1) {
      f[i] = ++tot;
      invf[f[i]] = i;
    }
  }
  for (int j = 1; j <= tot; j++) {
    int y = invf[j];
    memset(Y, 0, sizeof(Y));
    if (trap[y]) {
      for (int k = 1; k <= N; k++) {
        Y[k] = -(double)G[k][y] / (double)deg[k];
      }
    }
    for (int i = 1; i <= N; i++)
      if (trap[i] || i == 1) {
        double yi = 0.0;
        for (int k = 1; k <= N; k++) {
          yi += P[i][k] * Y[k];
        }
        W[f[i]][j] = yi;
      }
  }
  qpow(tot, W, K - 1, W);
  for (int i = 1; i <= tot; i++) {
    for (int j = 1; j <= tot; j++) {
    }
  }
  printf("%.10lf\n", W[1][tot]);
  return 0;
}
