#include <bits/stdc++.h>   using namespace std;   const int iinf = 1e9 + 7;   const long long linf = 1ll << 60;   const double dinf = 1e60;   template <typename T>   inline void scf(T &x) {     bool f = 0;     x = 0;     char c = getchar();     while ((c <  0  || c >  9 ) && c !=  - ) c = getchar();     if (c ==  - ) {       f = 1;       c = getchar();     }     while (c >=  0  && c <=  9 ) {       x = x * 10 + c -  0 ;       c = getchar();     }     if (f) x = -x;     return;   }   template <typename T1, typename T2>   void scf(T1 &x, T2 &y) {     scf(x);     return scf(y);   }   template <typename T1, typename T2, typename T3>   void scf(T1 &x, T2 &y, T3 &z) {     scf(x);     scf(y);     return scf(z);   }   template <typename T1, typename T2, typename T3, typename T4>   void scf(T1 &x, T2 &y, T3 &z, T4 &w) {     scf(x);     scf(y);     scf(z);     return scf(w);   }   inline char mygetchar() {     char c = getchar();     while (c ==     || c ==   n ) c = getchar();     return c;   }   template <typename T>   void chkmax(T &x, const T &y) {     if (y > x) x = y;     return;   }   template <typename T>   void chkmin(T &x, const T &y) {     if (y < x) x = y;     return;   }   const int N = 510;   const int M = 110;   int n, m, k;   double A[N][N + N];   double w[M][M], p[N][N];   bool f[N];   vector<int> trap;   double beg[N];   void calc_w() {     for (int i = (1); i <= (n); ++i) {       A[i][i] = 1.0;       if (!f[i])         for (int j = (1); j <= (n); ++j)           if (i != j) A[i][j] = -p[i][j];       A[i][i + n] = 1.0;     }     for (int row = 1, col = 1; row <= n; ++row) {       int pivot = row;       for (int i = (row + 1); i <= (n); ++i)         if (fabs(A[i][col]) > fabs(A[pivot][col])) pivot = i;       if (fabs(A[pivot][col]) <= 1e-6) continue;       swap(A[pivot], A[row]);       double foo = A[row][col];       for (int i = (1); i <= (n + n); ++i) A[row][i] /= foo;       for (int i = (1); i <= (n); ++i)         if (i != row) {           foo = A[i][col];           for (int j = (1); j <= (n + n); ++j) A[i][j] -= foo * A[row][j];         }       ++col;     }     for (int i = 0; i < (m); ++i)       for (int j = 0; j < (m); ++j) {         int u = trap[i], v = trap[j];         for (int k = (1); k <= (n); ++k) w[i][j] += p[u][k] * A[k][v + n];       }     for (int i = 0; i < (m); ++i) beg[i] = A[1][trap[i] + n];     return;   }   void TZL() {     static int g[N][N], deg[N];     memset((g), (0), sizeof((g)));     memset((deg), (0), sizeof((deg)));     scf(n, m, k);     for (int i = (1); i <= (n); ++i) {       scf(f[i]);       if (f[i]) trap.push_back(i);     }     for (int i = 0; i < (m); ++i) {       int u, v;       scf(u, v);       g[u][v]++;       g[v][u]++;       deg[u]++;       deg[v]++;     }     m = (int)trap.size();     for (int i = (1); i <= (n); ++i)       for (int j = (1); j <= (n); ++j) p[i][j] = (1.0 * g[i][j]) / (1.0 * deg[i]);     return calc_w();   }   struct mat {     double num[M][M];     mat() { memset((num), (0), sizeof((num))); }     mat(int x) {       memset((num), (0), sizeof((num)));       for (int i = 0; i < (M); ++i) num[i][i] = x;     }     mat(double a[][M]) {       for (int i = 0; i < (M); ++i)         for (int j = 0; j < (M); ++j) num[i][j] = a[i][j];     }     double &operator()(int i, int j) { return num[i][j]; }     double operator()(int i, int j) const { return num[i][j]; }     friend mat operator*(const mat &a, const mat &b) {       mat c;       for (int i = 0; i < (M); ++i)         for (int j = 0; j < (M); ++j)           for (int k = 0; k < (M); ++k) c(i, j) += a(i, k) * b(k, j);       return c;     }   } g;   mat kiss_me(mat a, int n) {     mat ret = mat(1);     while (n) {       if (n & 1) ret = ret * a;       a = a * a;       n >>= 1;     }     return ret;   }   void RANK1() {     g = mat(w);     g = kiss_me(g, k - 2);     double ans = 0.0;     for (int i = 0; i < (m); ++i) ans += beg[i] * g(i, m - 1);     printf( %.12f n , ans);     return;   }   int main() {     TZL();     RANK1();     return 0;   }