#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  int v = 0, f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void read(long long &x) {
  long long v = 0ll, f = 1ll;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void readc(char &x) {
  char c;
  while (((c = getchar()) == ' ') || c == '\n')
    ;
  x = c;
}
inline void writes(string s) { puts(s.c_str()); }
inline void writeln() { writes(""); }
inline void writei(int x) {
  if (x < 0) {
    putchar('-');
    x = abs(x);
  }
  if (!x) putchar('0');
  char a[25];
  int top = 0;
  while (x) {
    a[++top] = (x % 10) + '0';
    x /= 10;
  }
  while (top) {
    putchar(a[top]);
    top--;
  }
}
inline void writell(long long x) {
  if (x < 0) {
    putchar('-');
    x = abs(x);
  }
  if (!x) putchar('0');
  char a[25];
  int top = 0;
  while (x) {
    a[++top] = (x % 10) + '0';
    x /= 10;
  }
  while (top) {
    putchar(a[top]);
    top--;
  }
}
int n, m, i, j, k, kk, typ[505], ban[105], cnt, id[505];
int deg[505], px[100005], py[100005];
double f[505][605];
struct mat {
  double a[105][105];
} s, t;
mat mul(mat x, mat y) {
  mat z;
  int i, j, k;
  for (((i)) = (1); ((i)) <= ((cnt)); ((i))++)
    for (((j)) = (1); ((j)) <= ((cnt)); ((j))++) {
      z.a[i][j] = 0;
      for (((k)) = (1); ((k)) <= ((cnt)); ((k))++) {
        z.a[i][j] += x.a[i][k] * y.a[k][j];
      }
    }
  return z;
}
mat pw(mat x, int y, mat z) {
  while (y) {
    if (y & 1) z = mul(z, x);
    x = mul(x, x);
    y /= 2;
  }
  return z;
}
int main() {
  scanf("%d%d%d", &n, &m, &kk);
  for (((i)) = (1); ((i)) <= ((n)); ((i))++) {
    scanf("%d", &typ[i]);
    if (typ[i]) {
      ban[++cnt] = i;
      id[i] = cnt;
    }
  }
  for (((i)) = (1); ((i)) <= ((m)); ((i))++) {
    scanf("%d%d", &px[i], &py[i]);
    deg[px[i]]++;
    deg[py[i]]++;
  }
  for (((i)) = (1); ((i)) <= ((m)); ((i))++) {
    if (id[px[i]]) {
      f[py[i]][id[px[i]] + n] += 1.0 / deg[px[i]];
    } else {
      f[py[i]][px[i]] -= 1.0 / deg[px[i]];
    }
    if (id[py[i]]) {
      f[px[i]][id[py[i]] + n] += 1.0 / deg[py[i]];
    } else {
      f[px[i]][py[i]] -= 1.0 / deg[py[i]];
    }
  }
  f[1][n + cnt + 1] = 1;
  for (((i)) = (1); ((i)) <= ((n)); ((i))++) f[i][i] = 1;
  for (((i)) = (1); ((i)) <= ((n)); ((i))++) {
    int t = i;
    for ((j) = (i + 1); (j) <= (n); (j)++) {
      if (abs(f[j][i]) > abs(f[t][i])) {
        t = j;
      }
    }
    for (((k)) = (1); ((k)) <= ((n + cnt + 1)); ((k))++) {
      swap(f[i][k], f[t][k]);
    }
    double coef = f[i][i];
    for (((j)) = (1); ((j)) <= ((n + cnt + 1)); ((j))++) f[i][j] /= coef;
    for (((j)) = (1); ((j)) <= ((n)); ((j))++)
      if (j != i) {
        double coef = f[j][i] / f[i][i];
        for (((k)) = (1); ((k)) <= ((n + cnt + 1)); ((k))++) {
          f[j][k] -= f[i][k] * coef;
        }
      }
  }
  for (((i)) = (1); ((i)) <= ((cnt)); ((i))++)
    for (((j)) = (1); ((j)) <= ((cnt)); ((j))++) {
      t.a[i][j] = f[ban[j]][i + n];
    }
  for (((i)) = (1); ((i)) <= ((cnt)); ((i))++) {
    s.a[1][i] = f[ban[i]][n + cnt + 1];
  }
  t = pw(t, kk - 2, s);
  printf("%.10f\n", t.a[1][cnt]);
  return 0;
}
