#include <bits/stdc++.h>
using namespace std;
const int MAXN = 505, MAXT = 105;
int n, m, k, T;
bool trap[MAXN];
double co[MAXN][MAXN] = {}, cn[MAXN][MAXN] = {}, rhs[MAXN], p[MAXT][MAXT] = {},
       ze[MAXT] = {};
vector<int> adj[MAXN], tr;
void subtr(int r, int v, double m) {
  for (int i = 0; i < n; i++) {
    co[v][i] -= m * co[r][i];
    cn[v][i] -= m * cn[r][i];
  }
}
void solve() {
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      subtr(i, j, co[j][i] / co[i][i]);
    }
  }
  int k = tr.size();
  for (int i = n - 1; i >= 0; i--) {
    for (int j = i - 1; j >= 0; j--) {
      subtr(i, j, co[j][i] / co[i][i]);
    }
    for (int j = 0; j < n; j++) {
      cn[i][j] /= co[i][i];
    }
  }
}
vector<vector<double> > mul(vector<vector<double> > a,
                            vector<vector<double> > b) {
  vector<vector<double> > c;
  for (int i = 0; i < T; i++) {
    c.push_back(vector<double>(T));
  }
  for (int i = 0; i < T; i++) {
    for (int j = 0; j < T; j++) {
      c[i][j] = 0;
      for (int k = 0; k < T; k++) c[i][j] += a[i][k] * b[k][j];
    }
  }
  return c;
}
vector<vector<double> > mpow(vector<vector<double> > a, int p,
                             vector<vector<double> > b) {
  for (int i = 0; i < T; i++) {
    for (int j = 0; j < T; j++) b[i][j] = (i == j);
  }
  while (p) {
    if (p % 2 == 0) {
      a = mul(a, a);
      p /= 2;
    } else {
      b = mul(b, a);
      p--;
    }
  }
  return b;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(4);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> trap[i];
    if (trap[i]) tr.push_back(i);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = 0; i < n; i++) {
    cn[i][i] = 1;
    co[i][i] = -1;
    double s = adj[i].size();
    for (int j = 0; j < s; j++) {
      int v = adj[i][j];
      if (!trap[v]) co[i][v] += 1 / s;
    }
  }
  solve();
  for (int i = 0; i < tr.size(); i++) {
    memset(rhs, 0, sizeof(rhs));
    for (int j = 0; j < n; j++) {
      double s = adj[j].size();
      for (int k = 0; k < s; k++) {
        int v = adj[j][k];
        if (v == tr[i]) rhs[j] -= 1 / s;
      }
    }
    int l = 0;
    for (int j = 0; j < n; j++) ze[i] += cn[0][j] * rhs[j];
    for (int j = 0; j < n; j++) {
      if (trap[j]) {
        for (int k = 0; k < n; k++) {
          p[l][i] += cn[j][k] * rhs[k];
        }
        l++;
      }
    }
  }
  vector<vector<double> > pp, rr;
  T = tr.size();
  for (int i = 0; i < T; i++) {
    vector<double> v(p[i], p[i] + T);
    pp.push_back(v);
    rr.push_back(v);
  }
  rr = mpow(pp, k - 2, rr);
  double res = 0;
  for (int i = 0; i < T; i++) {
    res += rr[i][T - 1] * ze[i];
  }
  cout << res << '\n';
}
