#include <bits/stdc++.h>   using namespace std;   const int N = 505, M = 100500;   int read(int &n) {     char ch =    ;     int q = 0, w = 1;     for (; (ch !=  - ) && ((ch <  0 ) || (ch >  9 )); ch = getchar())       ;     if (ch ==  - ) w = -1, ch = getchar();     for (; ch >=  0  && ch <=  9 ; ch = getchar()) q = q * 10 + ch - 48;     n = q * w;     return n;   }   int m, n, m1;   int B[M * 2][2], A[N], B0, B1[N];   int b1[N], zx[N];   double s[N][N], t[N][N], di[N][N];   void link(int q, int w) {     B1[q]++, B1[w]++;     B[++B0][0] = A[q];     A[q] = B0, B[B0][1] = w;     B[++B0][0] = A[w];     A[w] = B0, B[B0][1] = q;   }   void chenans() {     for (int i = 1; i <= m; i++)       for (int j = 1; j <= m; j++) t[i][j] = 0;     for (int k = 1; k <= m; k++)       for (int i = 1; i <= m; i++)         for (int j = 1; j <= m; j++) t[i][j] += s[i][k] * di[k][j];     for (int i = 1; i <= m; i++)       for (int j = 1; j <= m; j++) s[i][j] = t[i][j];   }   void chen() {     for (int i = 1; i <= m; i++)       for (int j = 1; j <= m; j++) t[i][j] = 0;     for (int k = 1; k <= m; k++)       for (int i = 1; i <= m; i++)         for (int j = 1; j <= m; j++) t[i][j] += di[i][k] * di[k][j];     for (int i = 1; i <= m; i++)       for (int j = 1; j <= m; j++) di[i][j] = t[i][j];   }   double JC() {     while (m1) {       if (m1 & 1) chenans();       chen();       m1 >>= 1;     }     double ans = 0;     for (int i = 1; i <= m; i++) ans += s[i][m];     return ans;   }   double b[N][N], c[N][N];   int z[N];   void GS() {     for (int i = 1; i <= n; i++) {       b[i][i] = c[i][i] = 1;       for (int j = A[i]; j; j = B[j][0])         if (!zx[B[j][1]]) b[i][B[j][1]] -= 1.0 / B1[B[j][1]];     }     for (int i = 1; i <= n; i++) {       int q = i;       for (int j = i + 1; j <= n; j++)         if (((b[j][i]) > 0 ? (b[j][i]) : -(b[j][i])) >             ((b[q][i]) > 0 ? (b[q][i]) : -(b[q][i])))           q = j;       if (q != i) {         for (int j = 1; j <= n; j++)           swap(b[i][j], b[q][j]), swap(c[i][j], c[q][j]);       }       for (int j = 1; j <= n; j++)         if (i != j) {           double t = b[j][i] / b[i][i];           for (int k = 1; k <= n; k++)             b[j][k] -= t * b[i][k], c[j][k] -= t * c[i][k];         }     }     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++) c[i][j] /= b[i][i];     for (int i = A[1]; i; i = B[i][0]) z[B[i][1]]++;     for (int i = 1; i <= n; i++)       if (zx[i]) {         for (int j = 1; j <= n; j++)           s[zx[i]][zx[i]] += c[i][j] * ((double)z[j] / B1[1]);       }     for (int I = 1; I <= n; I++)       if (zx[I] && B1[I]) {         for (int i = 1; i <= n; i++) z[i] = 0;         for (int i = A[I]; i; i = B[i][0]) z[B[i][1]]++;         for (int i = 1; i <= n; i++)           if (zx[i]) {             for (int j = 1; j <= n; j++)               di[zx[I]][zx[i]] += c[i][j] * ((double)z[j] / B1[I]);           }       }   }   int main() {     int q, w;     read(n), read(m), read(m1);     m1 -= 2;     if (m1 < 0) {       printf( 0 n );       return 0;     }     for (int i = 1; i <= n; i++)       if (read(q)) b1[++b1[0]] = i, zx[i] = b1[0];     for (int i = 1; i <= m; i++) read(q), read(w), link(q, w);     GS();     m = b1[0];     printf( %.12lf n , JC());     return 0;   }