#include <bits/stdc++.h>
double a[505][505], b[505][505], res[505], f[505][505];
int n, m, k, p[505], de[505], l1[505], l2[505], d[505], tot1, tot2;
struct matrix {
  int n, m;
  double a[105][105];
  matrix(int _n, int _m) {
    n = _n;
    m = _m;
    memset(a, 0, sizeof(a));
  }
  matrix() {}
};
int gauss() {
  for (int i = 0; i < n; i++) {
    int j;
    for (j = i; j < n; j++)
      if (fabs(a[j][i]) > 1e-8) break;
    if (j == n) return false;
    if (j != i)
      for (int k = 0; k <= n; k++) {
        double t = a[j][k];
        a[j][k] = a[i][k];
        a[i][k] = t;
      }
    for (int j = i + 1; j < n; j++)
      if (fabs(a[j][i]) > 1e-8) {
        double t = a[i][i] / a[j][i];
        for (int k = i; k <= n; k++) a[j][k] = a[i][k] - a[j][k] * t;
        int k;
        for (k = i; k <= n; k++)
          if (fabs(a[j][k]) > 0) break;
        if (k == n + 1) continue;
        t = a[j][k];
        for (int l = k; l <= n; l++) a[j][l] /= t;
      }
  }
  return true;
}
void calc(int t) {
  memset(res, 0, sizeof(res));
  res[t] = 1;
  for (int i = tot2 - 1; i >= 0; i--) {
    for (int j = i + 1; j < n; j++) {
      double ans = 0;
      ans = res[j] * a[i][j];
      res[i] += -ans;
    }
    res[i] /= a[i][i];
  }
  for (int i = tot2; i < n; i++)
    for (int j = 0; j < n; j++)
      f[l1[i - tot2]][l1[t - tot2]] -= b[i][j] * res[j];
  f[0][l1[t - tot2]] = res[0];
}
matrix operator*(matrix A, matrix B) {
  matrix C;
  C.n = A.n;
  C.m = B.m;
  memset(C.a, 0, sizeof(C.a));
  for (int k = 0; k < B.n; k++)
    for (int i = 0; i < A.n; i++)
      if (fabs(A.a[i][k]) > 0)
        for (int j = 0; j < B.m; j++) C.a[i][j] += A.a[i][k] * B.a[k][j];
  return C;
}
matrix PowerMod(matrix A, int b) {
  matrix I(tot1, tot1);
  for (int i = 0; i < tot1; i++) I.a[i][i] = 1;
  while (b) {
    if (b & 1) I = I * A;
    A = A * A;
    b >>= 1;
  }
  return I;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) scanf("%d", &p[i]);
  for (int i = 0; i < n; i++) {
    if (p[i]) {
      l1[tot1] = i;
      d[i] = tot1++;
    } else {
      l2[tot2] = i;
      d[i] = tot2++;
    }
  }
  for (int i = 0; i < n; i++)
    if (p[i]) d[i] += tot2;
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    if (u == v) printf("error!\n");
    u--, v--;
    de[d[u]]++, de[d[v]]++;
    if (!p[u])
      a[d[u]][d[v]] += -1;
    else
      b[d[u]][d[v]] += -1;
    if (!p[v])
      a[d[v]][d[u]] += -1;
    else
      b[d[v]][d[u]] += -1;
  }
  for (int i = 0; i < tot2; i++)
    for (int j = 0; j < n; j++)
      if (de[i]) a[i][j] /= de[i];
  for (int i = tot2; i < n; i++)
    for (int j = 0; j < n; j++)
      if (de[i]) b[i][j] /= de[i];
  for (int i = 0; i < n; i++) a[i][i] = 1;
  gauss();
  for (int i = tot2; i < n; i++) calc(i);
  tot1++;
  matrix A(tot1, tot1);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (p[i] && p[j]) A.a[d[i] - tot2 + 1][d[j] - tot2 + 1] = f[i][j];
  for (int i = 1; i < n; i++)
    if (p[i]) A.a[0][d[i] - tot2 + 1] = f[0][i];
  matrix V(1, tot1);
  V.a[0][0] = 1;
  V = V * PowerMod(A, k - 1);
  printf("%.6lf\n", V.a[0][tot1 - 1]);
  return 0;
}
