#include <bits/stdc++.h>
using namespace std;
double P[5001][5001];
double Aux[125][125], C[125][125];
int eh[5001];
int grau[5001];
int del[5001];
int trap[5001];
int K;
int n;
void mul(double A[125][125], double B[125][125]) {
  for (int i = 0; i < K; i++)
    for (int j = 0; j < K; j++) Aux[i][j] = 0;
  for (int i = 0; i < K; i++)
    for (int j = 0; j < K; j++)
      for (int k = 0; k < K; k++) {
        Aux[i][j] += A[i][k] * B[k][j];
      }
  for (int i = 0; i < K; i++)
    for (int j = 0; j < K; j++) C[i][j] = Aux[i][j];
}
void exp(double M[125][125], int b) {
  if (b == 0) {
    memset(C, 0, sizeof C);
    for (int i = 0; i < n; i++) C[i][i] = 1;
    return;
  }
  exp(M, b / 2);
  mul(C, C);
  if (b % 2 == 1) mul(C, M);
}
void remove_self(int v) {
  double p = P[v][v];
  if (fabs(p) < 1e-9) return;
  p = 1. - p;
  P[v][v] = 0;
  for (int i = 0; i < n; i++) P[v][i] /= p;
}
void contrai2(int v) {
  double self = P[v][v];
  for (int a = 0; a < n; ++a) {
    if (a == v) continue;
    for (int b = 0; b < n; ++b) {
      if (b == v) continue;
      P[a][b] += P[a][v] * P[v][b] / (1 - self);
    }
  }
  for (int a = 0; a < n; ++a) P[a][v] = P[v][a] = 0;
}
void contrai(int v) {
  vector<int> aux;
  remove_self(v);
  for (int x = 0; x < n; x++)
    if (x != v) {
      for (int y = 0; y < n; y++)
        if (y != v) {
          P[x][y] += P[x][v] * P[v][y];
        }
      P[x][v] = 0;
    }
  del[v] = 1;
}
vector<int> T;
double M[125][125];
double ini[125];
int main() {
  int mortes;
  int m;
  cin >> n >> m >> mortes;
  for (int i = 0; i < n; i++) {
    cin >> trap[i];
    if (trap[i]) T.push_back(i);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    P[a][b] += 1., P[b][a] += 1.;
    grau[a]++, grau[b]++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      P[i][j] = P[i][j] / (double)grau[i];
    }
  }
  K = T.size();
  for (int i = 1; i < n; i++)
    if (!trap[i]) {
      contrai(i);
    }
  remove_self(0);
  for (int i = 0; i < T.size(); i++) ini[i] = P[0][T[i]];
  contrai(0);
  for (int i = 0; i < T.size(); i++)
    for (int j = 0; j < T.size(); j++) {
      M[i][j] = P[T[i]][T[j]];
    }
  exp(M, mortes - 2);
  double ans = 0;
  for (int i = 0; i < K; i++) ans += ini[i] * C[i][K - 1];
  printf("%.20f\n", ans);
  return 0;
}
