#include <bits/stdc++.h>
using namespace std;
template <class T>
bool uax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool uin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int MOD = 1000000007;
const int inf = 1e9 + 100500;
const double pi = acosl(-1.0);
const double eps = 1e-9;
const int N = 501;
double a[N][N];
double dv[N];
double d[N][N];
int g[N][N];
int s[N];
bool f[N];
int n;
void sqr(double a[N][N], int n) {
  static double ta[N][N], tb[N][N];
  for (int i = 0; i < (int)(n); ++i)
    for (int j = 0; j < (int)(n); ++j) ta[i][j] = tb[j][i] = a[i][j];
  for (int i = 0; i < (int)(n); ++i)
    for (int j = 0; j < (int)(n); ++j) a[i][j] = 0;
  for (int i = 0; i < (int)(n); ++i)
    for (int j = 0; j < (int)(n); ++j)
      for (int k = 0; k < (int)(n); ++k) a[i][j] += ta[i][k] * tb[j][k];
}
void mulpow(int n, double d[N][N], double dv[N], int k) {
  static double tv[N];
  while (k) {
    if (k & 1) {
      for (int i = 0; i < (int)(n); ++i) tv[i] = 0;
      for (int i = 0; i < (int)(n); ++i)
        for (int j = 0; j < (int)(n); ++j) tv[i] += dv[j] * d[i][j];
      for (int i = 0; i < (int)(n); ++i) dv[i] = tv[i];
    }
    if (k /= 2) {
      sqr(d, n);
    }
  }
}
void solve() {
  int m, k;
  n = 500;
  m = 100000;
  k = 1000000000;
  cin >> n >> m >> k;
  for (int i = 0; i < (int)(n); ++i) {
    f[i] = (rand() % 4 == 0);
    cin >> f[i];
  }
  f[0] = 0;
  f[n - 1] = 1;
  for (int i = 0; i < (int)(m); ++i) {
    int a, b;
    a = rand() % n;
    b = rand() % n;
    if (b == a) b = (a + 1) % n;
    cin >> a >> b;
    --a;
    --b;
    g[a][b] += 1;
    g[b][a] += 1;
    s[a] += 1;
    s[b] += 1;
  }
  for (int i = 0; i < (int)(n); ++i)
    if (!f[i]) {
      for (int j = 0; j < (int)(n); ++j) a[i][j] = (double)g[i][j] / s[i];
    } else {
      a[i][i] = (double)1.0;
    }
  for (int t = 0; t < (int)(17); ++t) sqr(a, n);
  vector<int> fn(n);
  int cntf = 0;
  for (int i = 0; i < (int)(n); ++i)
    if (f[i])
      fn[i] = cntf++;
    else
      fn[i] = -1;
  for (int i = 0; i < (int)(n); ++i)
    if (fn[i] != -1)
      for (int j = 0; j < (int)(n); ++j)
        if (fn[j] != -1) {
          for (int k = 0; k < (int)(n); ++k)
            if (fn[k] == -1) d[fn[i]][fn[j]] += g[i][k] * a[k][j] / s[i];
          d[fn[i]][fn[j]] += (double)g[i][j] / s[i];
        }
  for (int i = 0; i < (int)(cntf); ++i) dv[i] = 0;
  dv[fn[n - 1]] = 1;
  mulpow(cntf, d, dv, k - 2);
  double ans = 0;
  for (int i = 0; i < (int)(n); ++i)
    if (f[i]) ans += a[0][i] * dv[fn[i]];
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed;
  cout.precision(15);
  cerr << fixed;
  cerr.precision(15);
  solve();
  return 0;
}
