#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
using namespace std;
int N, M, K, B;
bool blk[505];
int top = 0;
int n[505], pos[505];
vector<int> Adj[505];
double b[505][2 * 505], c[505][505];
void printB() {
  cout << "%%%%%%% printB" << endl;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= 2 * N; j++) cout << b[i][j] << " ";
    cout << endl;
  }
  cout << endl;
}
void printC() {
  cout << "%%%%%%% printC" << endl;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) cout << c[i][j] << " ";
    cout << endl;
  }
  cout << endl;
}
bool Gauss();
struct mat {
  double a[105][105];
  mat() { memset(a, 0, sizeof(a)); }
  mat operator*(const mat& m1) const {
    mat ret;
    for (int i = 1; i <= B; i++) {
      for (int j = 1; j <= B; j++) {
        for (int k = 1; k <= B; k++) {
          ret.a[i][j] += a[i][k] * m1.a[k][j];
        }
      }
    }
    return ret;
  }
  void print() {
    cout << "%%%%%%%%% printT" << endl;
    for (int i = 1; i <= B; i++) {
      for (int j = 1; j <= B; j++) cout << a[i][j] << " ";
      cout << endl;
    }
    cout << endl;
  }
} t;
mat pow(mat x, long long n) {
  mat ret;
  for (int i = 1; i <= B; i++) {
    ret.a[i][i] = 1;
  }
  while (n) {
    if (n & 1) ret = ret * x;
    x = x * x;
    n /= 2;
  }
  return ret;
}
double w[505];
int main() {
  scanf("%d%d%d", &N, &M, &K);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &blk[i]);
    if (blk[i]) {
      n[++top] = i;
      pos[i] = top;
    }
  }
  B = top;
  int u, v;
  for (int i = 1; i <= M; i++) {
    scanf("%d%d", &u, &v);
    Adj[u].push_back(v);
    Adj[v].push_back(u);
  }
  for (u = 1; u <= N; u++) {
    int m = Adj[u].size();
    b[u][u] = m;
    for (int k = 0; k < m; k++) {
      int v1 = Adj[u][k];
      if (blk[v1])
        c[u][v1]++;
      else
        b[u][v1]--;
    }
    b[u][u + N] = 1;
  }
  Gauss();
  for (int k = 1; k <= N; k++) {
    if (!blk[k]) continue;
    int v = pos[k];
    for (int i = 1; i <= B; i++) {
      int u = n[i];
      for (int j = 1; j <= N; j++) {
        t.a[i][v] += b[u][N + j] * c[j][k];
      }
    }
    for (int j = 1; j <= N; j++) {
      w[v] += b[1][N + j] * c[j][k];
    }
  }
  t = pow(t, K - 2);
  double ans = 0;
  for (int i = 1; i <= B; i++) {
    ans += w[i] * t.a[i][B];
  }
  printf("%.6lf\n", ans);
  return 0;
}
bool Gauss() {
  for (int i = 1; i <= N; i++) {
    double div;
    for (int k = i + 1; k <= N; k++) {
      div = b[k][i] / b[i][i];
      for (int j = i; j <= 2 * N; j++) {
        b[k][j] -= div * b[i][j];
      }
    }
  }
  for (int i = N; i >= 1; i--) {
    for (int k = i + 1; k <= N; k++) {
      for (int j = 2 * N; j >= i; j--) {
        b[i][j] -= b[k][j] * b[i][k];
      }
    }
    for (int j = 2 * N; j >= i; j--) b[i][j] /= b[i][i];
  }
  return 1;
}
