#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
struct SMatrix {
  vector<valarray<double>> d;
  int N;
  SMatrix(int n, bool f = false) {
    N = n;
    d.resize(n);
    for (int i = 0; i < n; i++) {
      d[i] = valarray<double>(n);
    }
    for (int i = 0; i < N; i++) {
      d[i] = 0.0;
    }
    if (f) {
      for (int i = 0; i < N; i++) {
        d[i][i] = 1.0;
      }
    }
  }
  valarray<double>& operator[](int p) { return d[p]; }
  const valarray<double>& operator[](int p) const { return d[p]; }
  SMatrix& operator=(const SMatrix& other) {
    copy_n(other.d.begin(), N, d.begin());
    return *this;
  }
  SMatrix operator+(const SMatrix& right) {
    SMatrix res(N);
    for (int i = 0; i < N; i++) {
      res[i] = d[i] + right[i];
    }
    return res;
  }
  SMatrix operator*(const SMatrix& right) {
    SMatrix res(N), r(N);
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        r[i][j] = right[j][i];
      }
    }
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        res[i][j] = (d[i] * r[j]).sum();
      }
    }
    return res;
  }
  SMatrix operator*(const double x) {
    SMatrix res(N);
    for (int i = 0; i < N; i++) {
      res[i] = d[i] * x;
    }
    return res;
  }
  SMatrix pow(long long p) {
    SMatrix res(N, true), buf = *this;
    while (p != 0) {
      if (p % 2) {
        res = res * buf;
      }
      p /= 2;
      buf = buf * buf;
    }
    return res;
  }
  void mulL(int i, double x) { d[i] *= x; }
  void excL(int i, int j) { swap(d[i], d[j]); }
  void addL(int i, int j, double x) { d[i] += d[j] * x; }
  int inverse() {
    SMatrix r(N, true);
    for (int i = 0; i < N; i++) {
      if (d[i][i] == 0) {
        int j;
        for (j = i + 1; j < N; j++) {
          if (fabs(d[i][j]) > EPS) {
            r.excL(i, j);
            excL(i, j);
            break;
          }
        }
        if (j == N) return i;
      }
      r.mulL(i, 1 / d[i][i]);
      mulL(i, 1 / d[i][i]);
      for (int j = 0; j < N; j++) {
        if (i == j) continue;
        r.addL(j, i, -d[j][i]);
        addL(j, i, -d[j][i]);
      }
    }
    *this = r;
    return N;
  }
};
const int MN = 512;
int main() {
  int n, m;
  long long k;
  cin >> n >> m >> k;
  SMatrix A(n), B(n), C(n), D(n, true), E(n, true), nE(n, true);
  nE = nE * (-1);
  int d[MN];
  for (int i = 0; i < n; i++) {
    cin >> d[i];
  }
  int count[MN] = {};
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    if (!d[a]) {
      A[a][b] += 1;
    } else {
      B[a][b] += 1;
    }
    if (!d[b]) {
      A[b][a] += 1;
    } else {
      B[b][a] += 1;
    }
    count[a]++;
    count[b]++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      A[i][j] /= count[i];
      B[i][j] /= count[i];
    }
  }
  A = E + (A * (-1));
  A.inverse();
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (!d[i] && !d[j]) {
        A[i][j] = 0.0;
      }
    }
  }
  vector<int> v;
  for (int i = 0; i < n; i++) {
    if (d[i]) v.push_back(i);
  }
  int a = v.size();
  SMatrix F(a);
  C = B * A;
  for (int i = 0; i < a; i++) {
    for (int j = 0; j < a; j++) {
      F[i][j] = C[v[i]][v[j]];
    }
  }
  F = F.pow(k - 2);
  for (int i = 0; i < a; i++) {
    for (int j = 0; j < a; j++) {
      D[v[i]][v[j]] = F[i][j];
    }
  }
  D = A * D;
  printf("%.20f\n", D[0][n - 1]);
  return 0;
}
