#include <bits/stdc++.h>
using namespace std;
inline char ch() {
  static char s[1 << 16], *S, *T;
  return (S == T) && (T = (S = s) + fread(s, 1, 1 << 16, stdin), S == T) ? EOF
                                                                         : *S++;
}
template <typename T>
void read(T &x) {
  x = 0;
  int f(1);
  char c = ch();
  for (; !isdigit(c); c = ch())
    if (c == '-') f = -1;
  for (; isdigit(c); c = ch()) x = x * 10 + c - '0';
  x *= f;
}
template <typename T>
void write(T x, int f = 1) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10, 0);
  putchar('0' + x % 10);
  if (f) puts("");
}
const int maxn = 505;
const double eps = 1e-10;
int n, m, K, tr[maxn], tot, sz;
int id[maxn], idf[maxn], xs[maxn * 2];
double V[maxn * 2][maxn * 2];
int deg[maxn], e[maxn][maxn];
struct Vector {
  double A[maxn];
  Vector() { memset(A, 0, sizeof A); }
} Vec[maxn];
Vector operator+(const Vector &y, const Vector &x) {
  Vector ret;
  for (int j(1); j <= sz; ++j) ret.A[j] = y.A[j] + x.A[j];
  return ret;
}
Vector operator-(const Vector &y, const Vector &x) {
  Vector ret;
  for (int j(1); j <= sz; ++j) ret.A[j] = y.A[j] - x.A[j];
  return ret;
}
Vector Mul(Vector x, double y) {
  Vector ret;
  for (int j(1); j <= sz; ++j) ret.A[j] = x.A[j] * y;
  return ret;
}
Vector Div(Vector x, double y) {
  Vector ret;
  for (int j(1); j <= sz; ++j) ret.A[j] = x.A[j] / y;
  return ret;
}
struct matrix {
  double A[maxn][maxn];
  matrix() { memset(A, 0, sizeof A); }
  void init() {
    for (int i(0); i <= sz; ++i) A[i][i] = 1;
  }
};
matrix operator*(const matrix &y, const matrix &x) {
  matrix ret;
  for (int i(0); i <= sz; ++i)
    for (int j(0); j <= sz; ++j)
      for (int k(0); k <= sz; ++k) ret.A[i][j] += y.A[i][k] * x.A[k][j];
  return ret;
}
matrix qp(matrix a, int b) {
  matrix ret;
  ret.init();
  while (b) {
    if (b & 1) ret = ret * a;
    a = a * a;
    b >>= 1;
  }
  return ret;
}
int main() {
  read(n);
  read(m);
  read(K);
  for (int i(1); i <= n; ++i) read(tr[i]), sz += tr[i];
  for (int i(1); i <= m; ++i) {
    int u, v;
    read(u);
    read(v);
    ++deg[u], ++deg[v];
    ++e[u][v];
    ++e[v][u];
  }
  for (int i(1); i <= n; ++i)
    if (tr[i]) id[++tot] = i, idf[i] = tot;
  for (int i(1); i <= n; ++i) {
    V[i][i] = -1;
    for (int j(1); j <= n; ++j)
      if (tr[j])
        V[i][idf[j] + n] += 1.0 * e[i][j] / deg[i];
      else
        V[i][j] += 1.0 * e[i][j] / deg[i];
  }
  for (int i(1); i <= tot; ++i) Vec[i + n].A[i] = 1.0, V[i + n][i + n] = 1.0;
  for (int i(1); i <= n + tot; ++i) {
    int mxj = -1;
    double mx = 0;
    for (int j(1); j <= n + tot; ++j)
      if (abs(V[i][j]) > mx) mx = abs(V[i][j]), mxj = j;
    if (mxj == -1 || mx <= eps) continue;
    xs[i] = mxj;
    double tmp = V[i][mxj];
    for (int j(1); j <= n + tot; ++j) V[i][j] /= tmp;
    Vec[i] = Div(Vec[i], tmp);
    for (int j(1); j <= n + tot; ++j) {
      if (j == i || abs(V[j][mxj]) <= eps) continue;
      tmp = V[j][mxj];
      for (int k(1); k <= n + tot; ++k) V[j][k] -= V[i][k] * tmp;
      Vec[j] = Vec[j] - Mul(Vec[i], tmp);
    }
  }
  matrix ans;
  for (int i(1); i <= n + tot; ++i)
    if (xs[i] == 1 || (xs[i] <= n && tr[xs[i]])) {
      if (xs[i] == 1) {
        for (int j(1); j <= tot; ++j) ans.A[0][j] = Vec[i].A[j];
      } else {
        for (int j(1); j <= tot; ++j) ans.A[idf[xs[i]]][j] = Vec[i].A[j];
      }
    }
  ans = qp(ans, K - 1);
  printf("%.8lf\n", ans.A[0][idf[n]]);
  return 0;
}
