#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const int N = 500 + 11;
int imp[N];
vector<int> e[N];
vector<int> im;
double mat[N][N];
double rhs[N][N];
double vec[N];
int gauss(int n) {
  int rows = 0;
  int i, j, t;
  for (int col = 0; col < n; col++) {
    int next = rows;
    for (i = rows + 1; i < n; i++)
      if (fabs(mat[i][col]) > fabs(mat[next][col])) next = i;
    if (fabs(mat[next][col]) < 1e-4) continue;
    if (next != rows) {
      for (i = 0; i < n; i++) {
        swap(mat[next][i], mat[rows][i]);
        swap(rhs[next][i], rhs[rows][i]);
      }
    }
    double c = 1 / mat[rows][col];
    for (i = 0; i < n; i++) {
      mat[rows][i] *= c;
      rhs[rows][i] *= c;
    }
    for (i = rows + 1; i < n; i++) {
      double c = mat[i][col];
      for (j = 0; j < n; j++) {
        mat[i][j] -= mat[rows][j] * c;
        rhs[i][j] -= rhs[rows][j] * c;
      }
    }
    rows++;
  }
  for (i = rows - 1; i >= 0; i--) {
    int col = 0;
    while (fabs(mat[i][col]) < 1e-4) col++;
    if (col > i) {
      for (j = 0; j < n; j++) {
        swap(mat[i][j], mat[col][j]);
        swap(rhs[i][j], rhs[col][j]);
      }
      for (j = i; j < col; j++) {
        memset(mat[j], 0, sizeof(mat[j]));
        memset(rhs[j], 0, sizeof(rhs[j]));
        mat[j][j] = 1;
      }
    }
    for (j = col + 1; j < n; j++) {
      for (t = 0; t < n; t++) rhs[col][t] -= rhs[j][t] * mat[col][j];
      mat[col][j] = 0;
    }
  }
  return rows;
}
double TM[N][N];
void mul(double a[N][N], double b[N][N], int n, double c[N][N]) {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      TM[i][j] = 0;
      for (int k = 0; k < n; ++k) {
        TM[i][j] = (TM[i][j] + a[i][k] * b[k][j]);
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      c[i][j] = TM[i][j];
    }
  }
}
void po(double a[N][N], int n, long long b, double c[N][N]) {
  int i;
  memset(c, 0, sizeof(c));
  for (i = 0; i < n; i++) c[i][i] = 1;
  while (b > 0) {
    if (b & 1) {
      mul(a, c, n, c);
    }
    mul(a, a, n, a);
    b >>= 1;
  }
}
double E[N][N];
double nxt[N][N];
int main() {
  int n, m, k, a, b, i, j, r;
  cin >> n >> m >> k;
  im.push_back(0);
  for (i = 0; i < n; i++) {
    scanf("%d", imp + i);
    if (imp[i]) im.push_back(i);
  }
  for (i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    a--;
    b--;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  memset(nxt, 0, sizeof(nxt));
  memset(mat, 0, sizeof(mat));
  memset(rhs, 0, sizeof(rhs));
  for (i = 0; i < n; i++) {
    mat[i][i] = rhs[i][i] = 1;
    double c = 1 / double(e[i].size());
    for (r = 0; r < e[i].size(); r++) {
      int v = e[i][r];
      if (!imp[v]) mat[i][v] -= c;
    }
  }
  gauss(n);
  for (i = 1; i <= im.size() - 1; i++) {
    memset(vec, 0, sizeof(vec));
    for (j = 0; j < n; j++) {
      mat[j][j] = 1;
      double c = 1 / double(e[j].size());
      for (r = 0; r < e[j].size(); r++) {
        int v = e[j][r];
        if (v == im[i]) vec[j] += c;
      }
    }
    for (j = 0; j < im.size(); j++) {
      for (r = 0; r < n; r++) {
        nxt[j][i] += rhs[im[j]][r] * vec[r];
      }
    }
  }
  k--;
  po(nxt, im.size(), k, E);
  printf("%.6lf\n", E[0][im.size() - 1]);
  return 0;
}
