#include <bits/stdc++.h>
using namespace std;
namespace matrix {
template <int N, int M>
class matr {
 public:
  double dat[N][M];
  void init() { memset(dat, 0, sizeof(dat)); }
  void iden() {
    init();
    for (int i = 0; i < min(N, M); i++) dat[i][i] = 1;
  }
  matr<M, N> trans() {
    matr<M, N> out;
    for (int i = 0; i < M; i++)
      for (int j = 0; j < N; j++) out[i][j] = dat[j][i];
  }
  const double *operator[](const int &x) const { return dat[x]; }
  double *operator[](const int &x) { return dat[x]; }
  template <int X>
  friend matr<N, M> operator*(const matr<N, X> a, const matr<X, M> b) {
    matr<N, M> out;
    out.init();
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < X; j++) {
        if (a[i][j] != 0) {
          for (int k = 0; k < M; k++) out[i][k] += a[i][j] * b[j][k];
        }
      }
    }
    return out;
  }
};
};  // namespace matrix
using namespace matrix;
int n, m, K, flag[510], id[510];
vector<int> special;
double a[510][510], lft[510];
vector<pair<pair<int, int>, double> > opt;
vector<int> v[510];
void gauss() {
  for (int i = 1; i <= n; i++) {
    int pos = -1;
    for (int j = i; j <= n; j++) {
      if (fabs(a[j][i]) > 1e-12) {
        pos = j;
        break;
      }
    }
    assert(pos != -1);
    swap(id[pos], id[i]);
    for (int j = 1; j <= n; j++) swap(a[pos][j], a[i][j]);
    for (int j = 1; j <= n; j++) {
      if (j != pos) {
        double dlt = a[j][i] / a[pos][i];
        opt.push_back(make_pair(make_pair(id[j], id[pos]), dlt));
        for (int k = 1; k <= n; k++) a[j][k] -= a[pos][k] * dlt;
      }
    }
  }
}
double cur[510];
void solve() {
  for (auto &x : opt) cur[x.first.first] -= cur[x.first.second] * x.second;
  for (int i = 1; i <= n; i++) {
    cur[id[i]] /= a[i][i];
  }
}
matr<110, 110> g;
int main() {
  scanf("%d%d%d", &n, &m, &K);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &flag[i]);
    if (flag[i]) special.push_back(i);
  }
  for (int i = 1, ti, tj; i <= m; i++) {
    scanf("%d%d", &ti, &tj);
    v[ti].push_back(tj);
    v[tj].push_back(ti);
  }
  for (int i = 1; i <= n; i++) {
    id[i] = i;
    double bas = 1.0 / v[i].size();
    for (auto &x : v[i]) {
      if (!flag[x]) a[i][x] -= bas;
    }
    a[i][i] = 1;
  }
  gauss();
  matr<1, 110> ans;
  ans.init();
  for (int i = 0; i < special.size(); i++) {
    int x = special[i];
    memset(cur, 0, sizeof(cur));
    for (auto &y : v[x]) cur[y] += 1.0 / v[y].size();
    solve();
    ans[0][i] = cur[id[1]];
    for (int j = 0; j < special.size(); j++) g[j][i] = cur[id[special[j]]];
  }
  K -= 2;
  while (K) {
    if (K & 1) ans = ans * g;
    g = g * g;
    K >>= 1;
  }
  printf("%.10lf\n", ans[0][special.size() - 1]);
  return 0;
}
