#include <bits/stdc++.h>
using namespace std;
const int N = 505, M = 105;
int n, m, K, tot, x, y, flag[N], a[N], id[N];
double f[N][N + M];
vector<int> v[N];
struct zz {
  double a[M][M];
} A;
zz cf(zz x, zz y) {
  zz z;
  memset(z.a, 0, sizeof z);
  for (int i = 1; i <= tot; i++)
    for (int j = 1; j <= tot; j++)
      for (int k = 1; k <= tot; k++) z.a[i][j] += x.a[i][k] * y.a[k][j];
  return z;
}
zz ksm(zz x, int y) {
  zz z;
  memset(z.a, 0, sizeof z.a);
  for (int i = 1; i <= tot; i++) z.a[i][i] = 1;
  for (; y; y >>= 1, x = cf(x, x))
    if (y & 1) z = cf(z, x);
  return z;
}
void gauss() {
  for (int i = 1; i <= n; i++) {
    int k = i;
    for (int j = i; j <= n; j++)
      if (fabs(f[j][i]) > fabs(f[k][i])) k = j;
    swap(f[k], f[i]);
    for (int j = i + 1; j <= n; j++) {
      double temp = f[j][i] / f[i][i];
      for (int k = i; k <= n + tot; k++) f[j][k] -= temp * f[i][k];
    }
  }
  for (int i = n; i; i--) {
    for (int j = n; j > i; j--)
      for (int k = 1; k <= tot; k++) f[i][k + n] += f[i][j] * f[j][k + n];
    for (int k = 1; k <= tot; k++) f[i][k + n] /= -f[i][i];
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &K);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &flag[i]);
    if (flag[i]) a[++tot] = i, id[i] = tot;
  }
  while (m--) {
    scanf("%d%d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    f[i][i] = -1;
    if (flag[i])
      f[i][id[i] + n] = 1;
    else
      for (int j : v[i]) f[i][j] += 1.0 / v[i].size();
  }
  gauss();
  for (int i = 1; i <= tot; i++)
    for (int j = 1; j <= tot; j++)
      for (int k : v[a[i]]) A.a[j][i] += f[k][j + n] / v[a[i]].size();
  A = ksm(A, K - 2);
  double ans = 0;
  for (int i = 1; i <= tot; i++) ans += f[1][i + n] * A.a[tot][i];
  printf("%.10lf\n", ans);
  return 0;
}
