#include <bits/stdc++.h>
struct Matrix {
  int n, m;
  double a[110][110];
  Matrix(int n, int m) : n(n), m(m) { memset(a, 0, sizeof(a)); }
  double *operator[](int x) { return a[x]; }
};
Matrix operator*(Matrix x, Matrix y) {
  Matrix z(x.n, y.m);
  for (int i = 1; i <= x.n; i++)
    for (int k = 1; k <= x.m; k++)
      for (int j = 1; j <= y.m; j++) z[i][j] += x[i][k] * y[k][j];
  return z;
}
Matrix ksm(Matrix x, int y) {
  Matrix z(x.n, x.n);
  for (int i = 1; i <= x.n; i++) z[i][i] = 1;
  for (; y; y >>= 1, x = x * x)
    if (y & 1) z = x * z;
  return z;
}
int n, m, K, deg[510], a[110], typ[510];
double A[510][510 + 110];
std::vector<int> to[510];
int main() {
  scanf("%d%d%d", &n, &m, &K);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &typ[i]);
    if (typ[i]) a[++a[0]] = i;
  }
  for (int i = 1, x, y; i <= m; i++) {
    scanf("%d%d", &x, &y);
    deg[x]++, deg[y]++;
    to[x].push_back(y), to[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    if (!typ[i]) {
      for (auto j : to[i]) A[i][j] += 1.0 / deg[i];
      A[i][i] = -1;
    } else {
      A[i][i] = 1;
      for (int j = 1; j <= a[0]; j++)
        if (a[j] == i) A[i][n + j] = 1;
    }
  }
  int lim = a[0] + n;
  double t;
  for (int i = 1; i <= n; i++) {
    t = A[i][i];
    for (int j = 1; j <= lim; j++) A[i][j] /= t;
    for (int j = 1; j <= n; j++) {
      if (j == i) continue;
      t = A[j][i] / A[i][i];
      for (int k = 1; k <= lim; k++) A[j][k] -= A[i][k] * t;
    }
  }
  Matrix x(1, a[0]), y(a[0], a[0]);
  for (int i = 1; i <= a[0]; i++) x[1][i] = A[1][n + i];
  for (int i = 1; i <= a[0]; i++)
    for (int j = 1; j <= a[0]; j++) {
      for (auto k : to[a[i]]) y[i][j] += A[k][n + j];
      y[i][j] /= deg[a[i]];
    }
  x = x * ksm(y, K - 2);
  printf("%.6lf\n", x[1][a[0]]);
  return 0;
}
