#include <bits/stdc++.h>
using namespace std;
const int N = 666;
const double eps = 1e-10;
int n, m, K, cnt, sz;
int id[N], nod[N], cur[N];
double deg[N], g[N][N];
bool trap[N];
double v[N][N];
struct node {
  double vec[N];
} vv[N];
struct mat {
  double v[505][505];
  mat() { memset(v, 0, sizeof(v)); }
} ans;
node operator*(node a, double w) {
  for (int i = 0; i <= n; i++) a.vec[i] *= w;
  return a;
}
node operator/(node a, double w) {
  for (int i = 0; i <= n; i++) a.vec[i] /= w;
  return a;
}
node operator+(node a, node b) {
  for (int i = 0; i <= n; i++) a.vec[i] += b.vec[i];
  return a;
}
node operator-(node a, node b) {
  for (int i = 0; i <= n; i++) a.vec[i] -= b.vec[i];
  return a;
}
mat operator*(mat a, mat b) {
  mat t;
  memset(t.v, 0, sizeof(t.v));
  for (int i = 0; i <= sz; i++) {
    for (int j = 0; j <= sz; j++) {
      for (int k = 0; k <= sz; k++) {
        t.v[i][j] += a.v[i][k] * b.v[k][j];
      }
    }
  }
  return t;
}
int main() {
  cin >> n >> m >> K;
  for (int i = 1; i <= n; i++) scanf("%d", &trap[i]);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    ++deg[x], ++deg[y], ++g[x][y], ++g[y][x];
  }
  for (int i = 1; i <= n; i++) {
    if (trap[i]) {
      nod[++cnt] = i, id[i] = cnt;
    }
  }
  sz = cnt;
  for (int i = 1; i <= n; i++) {
    v[i][i] = -1;
    for (int j = 1; j <= n; j++) {
      if (trap[j]) {
        v[i][id[j] + n] += 1.0 * g[i][j] / deg[i];
      } else {
        v[i][j] += 1.0 * g[i][j] / deg[i];
      }
    }
  }
  for (int i = 1; i <= sz; i++) {
    vv[i + n].vec[i] = 1;
    v[i + n][i + n] = 1;
  }
  for (int i = 1; i <= n + sz; i++) {
    int me = -1;
    double mx = 0;
    for (int j = 1; j <= n + sz; j++) {
      if (abs(v[i][j]) > mx) {
        mx = abs(v[i][j]);
        me = j;
      }
    }
    if (me == -1 || abs(mx) < eps) continue;
    cur[i] = me;
    double val = v[i][me];
    for (int j = 1; j <= n + sz; j++) v[i][j] /= val;
    vv[i] = vv[i] / val;
    for (int j = 1; j <= n + sz; j++) {
      if (j != i && abs(v[j][me]) > eps) {
        double val = v[j][me];
        for (int k = 1; k <= n + sz; k++) v[j][k] -= v[i][k] * val;
        vv[j] = vv[j] - vv[i] * val;
      }
    }
  }
  for (int i = 1; i <= n + sz; i++) {
    if ((cur[i] <= n && trap[cur[i]]) || cur[i] == 1) {
      if (cur[i] == 1) {
        for (int j = 1; j <= sz; j++) ans.v[0][j] = vv[i].vec[j];
      } else {
        for (int j = 1; j <= sz; j++) ans.v[id[cur[i]]][j] = vv[i].vec[j];
      }
    }
  }
  mat res;
  memset(res.v, 0, sizeof(res.v));
  for (int i = 0; i <= sz; i++) res.v[i][i] = 1;
  int nn = K - 1;
  for (; nn; nn >>= 1) {
    if (nn & 1) res = res * ans;
    ans = ans * ans;
  }
  printf("%.10lf\n", res.v[0][id[n]]);
  return 0;
}
