#include <bits/stdc++.h>
using namespace std;
int n, m, K, tot;
double f[510][610];
int dan[510], d[510], p[510], pa[100010], pb[100010];
struct M {
  double v[105][105];
  M() { memset(v, 0, sizeof(v)); }
  double *operator[](const int &a) { return v[a]; }
  inline M operator*(const M &a) const {
    M b;
    int i, j, k;
    for (i = 1; i <= tot; i++)
      for (j = 1; j <= tot; j++)
        for (k = 1; k <= tot; k++) b.v[i][j] += v[i][k] * a.v[k][j];
    return b;
  }
} S, T;
inline void pm(int y) {
  while (y) {
    if (y & 1) S = S * T;
    T = T * T, y >>= 1;
  }
}
inline int rd() {
  int ret = 0, f = 1;
  char gc = getchar();
  while (gc < '0' || gc > '9') {
    if (gc == '-') f = -f;
    gc = getchar();
  }
  while (gc >= '0' && gc <= '9') ret = ret * 10 + (gc ^ '0'), gc = getchar();
  return ret * f;
}
int main() {
  n = rd(), m = rd(), K = rd();
  int i, j, k, a, b;
  for (i = 1; i <= n; i++) {
    dan[i] = rd();
    if (dan[i]) dan[i] = ++tot, p[tot] = i;
  }
  for (i = 1; i <= m; i++) pa[i] = rd(), pb[i] = rd(), d[pa[i]]++, d[pb[i]]++;
  for (i = 1; i <= m; i++) {
    a = pa[i], b = pb[i];
    if (!dan[a])
      f[b][a] -= 1.0 / d[a];
    else
      f[b][dan[a] + n] += 1.0 / d[a];
    if (!dan[b])
      f[a][b] -= 1.0 / d[b];
    else
      f[a][dan[b] + n] += 1.0 / d[b];
  }
  f[1][n + tot + 1] = 1;
  for (i = 1; i <= n; i++) f[i][i] += 1;
  for (i = 1; i <= n; i++) {
    for (j = k = i; j <= n; j++)
      if (fabs(f[j][i]) > fabs(f[k][i])) k = j;
    if (i != k)
      for (j = i; j <= n + tot + 1; j++) swap(f[i][j], f[k][j]);
    double tmp = f[i][i];
    for (j = i; j <= n + tot + 1; j++) f[i][j] /= tmp;
    for (j = 1; j <= n; j++)
      if (j != i) {
        tmp = f[j][i];
        for (k = 1; k <= n + tot + 1; k++) f[j][k] -= f[i][k] * tmp;
      }
  }
  for (i = 1; i <= tot; i++)
    for (j = 1; j <= tot; j++) T[i][j] = f[p[j]][i + n];
  for (i = 1; i <= tot; i++) S[1][i] = f[p[i]][n + tot + 1];
  pm(K - 2);
  printf("%.10lf", S[1][tot]);
  return 0;
}
