#include <bits/stdc++.h>
using namespace std;
int n;
int m;
int k;
int flag[502];
vector<double> g[502];
double deg[502];
double cnt[502][502];
double dist[502][502];
const int matrix_size = 102;
struct matrix {
  double mat[matrix_size][matrix_size];
  matrix() { memset(mat, 0, sizeof(mat)); }
};
matrix operator*(const matrix &a, const matrix &b) {
  matrix r;
  double tmp;
  for (int i = 0; i < matrix_size; i++) {
    for (int j = 0; j < matrix_size; j++) {
      tmp = 0;
      for (int k = 0; k < matrix_size; k++) {
        tmp += (double)(a.mat[i][k]) * b.mat[k][j];
      }
      r.mat[i][j] = tmp;
    }
  }
  return r;
}
matrix operator+(const matrix &a, const matrix &b) {
  matrix r;
  for (int i = 0; i < matrix_size; i++) {
    for (int j = 0; j < matrix_size; j++) {
      r.mat[i][j] += a.mat[i][j] + b.mat[i][j];
    }
  }
  return r;
}
matrix ppow(matrix i, long long int j) {
  if (j == 0) {
    for (int i1 = 0; i1 < matrix_size; i1++) {
      for (int j = 0; j < matrix_size; j++) {
        i.mat[i1][j] = (i1 == j);
      }
    }
    return i;
  }
  if (j == 1LL) {
    return i;
  }
  j--;
  matrix r = i;
  while (j) {
    if ((j & 1LL)) {
      r = r * i;
    }
    i = i * i;
    j >>= 1LL;
  }
  return r;
}
vector<int> v;
matrix mat;
int idx[502];
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    scanf("%d", &flag[i]);
    if (i == 0 || flag[i]) {
      v.push_back(i);
    }
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    cnt[a][b] += 1;
    cnt[b][a] += 1;
    deg[a]++;
    deg[b]++;
  }
  for (int i = 0; i < n; i++) {
    g[i].assign(n * 2, 0);
    g[i][i] = -1;
    if (flag[i] == false) {
      for (int j = 0; j < n; j++) {
        if (j != i) {
          g[i][j] = cnt[i][j] / deg[i];
        }
      }
    } else {
      g[i][i + n] = 1;
      g[i][i] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    double mx = 0;
    int id = -1;
    for (int j = i; j < n; j++) {
      mx = max(mx, fabs(g[j][i]));
      if (mx == fabs(g[j][i])) {
        id = j;
      }
    }
    if (mx == 0.0) continue;
    swap(g[i], g[id]);
    double pr = g[i][i];
    for (int j = i + 1; j < n; j++) {
      double rat = g[j][i] / pr;
      for (int k = i; k < n * 2; k++) {
        g[j][k] -= rat * g[i][k];
      }
    }
  }
  for (int k = 0; k < n; k++) {
    if (flag[k] == false) continue;
    dist[k][k] = 1;
    for (int i = n - 1; i >= 0; i--) {
      if (flag[i]) continue;
      double r = 0;
      r = g[i][k + n];
      for (int j = n - 1; j > i; j--) {
        r -= dist[j][k] * g[i][j];
      }
      r /= g[i][i];
      dist[i][k] = r;
    }
    for (int i = 0; i < n; i++) {
      if (flag[i] && i != k) {
        for (int j = 0; j < n; j++) {
          if (i != j) {
            if (j == k || flag[j] == false) {
              dist[i][k] += dist[j][k] * cnt[i][j] / deg[i];
            }
          }
        }
      }
    }
    int i = k;
    dist[i][k] = 0;
    for (int j = 0; j < n; j++) {
      if (i != j) {
        if (j == k || flag[j] == false) {
          dist[i][k] += dist[j][k] * cnt[i][j] / deg[i];
        }
      }
    }
  }
  int c = -1;
  for (int id : v) {
    c++;
    idx[id] = c;
  }
  for (int id : v) {
    for (int go : v) {
      if (go == 0) continue;
      double &pro = dist[id][go];
      mat.mat[idx[go]][idx[id]] = pro;
    }
  }
  mat = ppow(mat, k - 1);
  double ans = mat.mat[c][0];
  printf("%.16f\n", ans);
  return 0;
}
