#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int inf = 0x3f3f3f3f;
const long long inf64 = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-6;
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& p) {
  return os << p.first << "," << p.second;
}
template <typename A>
ostream& operator<<(ostream& os, const vector<A>& v) {
  for (int i = 0; i < v.size(); i++) {
    os << v[i] << ";";
  }
  return os;
}
template <typename A>
ostream& operator<<(ostream& os, const set<A>& v) {
  for (typename set<A>::const_iterator it = v.begin(); it != v.end(); ++it) {
    os << *it << ";";
  }
  return os;
}
template <typename A, typename B>
ostream& operator<<(ostream& os, const map<A, B>& v) {
  for (typename map<A, B>::const_iterator it = v.begin(); it != v.end(); ++it) {
    os << it->first << "=" << it->second << ";";
  }
  return os;
}
const int maxn = 509;
const int maxt = 104;
int trap[maxn];
int a[maxn][maxn];
vector<int> g[maxn];
double b[maxn][maxn + maxt];
double d[maxt][maxt];
double rd[maxt][maxt];
double tmp[maxt][maxt];
void mul(const double a[maxt][maxt], const double b[maxt][maxt],
         double r[maxt][maxt]) {
  for (int i = 0; i < maxt; i++) {
    for (int j = 0; j < maxt; j++) {
      tmp[i][j] = 0;
      for (int k = 0; k < maxt; k++) {
        tmp[i][j] += a[i][k] * b[k][j];
      }
    }
  }
  for (int i = 0; i < maxt; i++) {
    for (int j = 0; j < maxt; j++) {
      r[i][j] = tmp[i][j];
    }
  }
}
void pw(double a[maxt][maxt], double r[maxt][maxt], int p) {
  for (int i = 0; i < maxt; i++) {
    for (int j = 0; j < maxt; j++) {
      r[i][j] = 0;
    }
    r[i][i] = 1;
  }
  for (; p; p >>= 1) {
    if (p & 1) {
      mul(r, a, r);
    }
    mul(a, a, a);
  }
}
int trapindex[maxn];
vector<double> getrowsum(int h, int w) {
  vector<double> ans(h);
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      ans[i] += b[i][j];
    }
  }
  return ans;
}
vector<double> getcolsum(int h, int w) {
  vector<double> ans(w);
  for (int i = 0; i < w; i++) {
    for (int j = 0; j < h; j++) {
      ans[i] += b[j][i];
    }
  }
  return ans;
}
double getsum(int h, int w) {
  double ans = 0;
  for (int i = 0; i < w; i++) {
    for (int j = 0; j < h; j++) {
      ans += b[j][i];
    }
  }
  return ans;
}
vector<double> getabsrowsum(int h, int w) {
  vector<double> ans(h);
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      ans[i] += abs(b[i][j]);
    }
  }
  return ans;
}
vector<double> getabscolsum(int h, int w) {
  vector<double> ans(w);
  for (int i = 0; i < w; i++) {
    for (int j = 0; j < h; j++) {
      ans[i] += abs(b[j][i]);
    }
  }
  return ans;
}
double getabssum(int h, int w) {
  double ans = 0;
  for (int i = 0; i < w; i++) {
    for (int j = 0; j < h; j++) {
      ans += abs(b[j][i]);
    }
  }
  return ans;
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  assert(n < maxn);
  for (int i = 0; i < n; i++) {
    cin >> trap[i];
  }
  vector<int> trapvectices;
  for (int i = 0; i < n; i++)
    if (trap[i]) {
      trapvectices.push_back(i);
      trapindex[i] = trapvectices.size() - 1;
    }
  int r = trapvectices.size();
  assert(r < maxt);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    a[x][y]++;
    a[y][x]++;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  vector<double> initprob;
  for (int i = 0; i < n; i++) {
    b[i][i] = 1;
    for (int j = 0; j < n; j++)
      if (j != i) {
        if (trap[j]) {
          b[i][n + trapindex[j]] = a[i][j] / double(g[i].size());
        } else {
          b[i][j] = -a[i][j] / double(g[i].size());
        }
      }
  }
  int row = 0;
  for (int col = 0; col < n; col++) {
    int best = -1;
    for (int i = row; i < n; i++) {
      if (best < 0 || abs(b[i][col]) > abs(b[best][col])) {
        best = i;
      }
    }
    if (best < 0 || abs(b[best][col]) < eps) {
      continue;
    }
    if (best != row) {
      for (int i = 0; i < n + r; i++) {
        swap(b[best][i], b[row][i]);
      }
    }
    double q = b[row][col];
    for (int i = 0; i < n + r; i++) {
      b[row][i] /= q;
    }
    for (int i = row + 1; i < n; i++)
      if (i != row) {
        double q = b[i][col];
        for (int j = 0; j < n + r; j++) {
          b[i][j] -= q * b[row][j];
        }
      }
    row++;
  }
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < i; j++) {
      double q = b[j][i];
      for (int k = 0; k < n + r; k++) {
        b[j][k] -= q * b[i][k];
      }
    }
  }
  assert(row == n);
  for (int k = 0; k < r; k++) {
    initprob.push_back(b[0][n + k]);
  }
  for (int i = 0; i < trapvectices.size(); i++) {
    int w = trapvectices[i];
    for (int k = 0; k < r; k++) {
      d[i][k] = b[w][n + k];
    }
  }
  auto res = initprob;
  int pp = k - 2;
  for (; pp; pp >>= 1) {
    if (pp & 1) {
      for (int i = 0; i < r; i++) {
        tmp[0][i] = 0;
        for (int j = 0; j < r; j++) {
          tmp[0][i] += res[j] * d[j][i];
        }
      }
      for (int i = 0; i < r; i++) {
        res[i] = tmp[0][i];
      }
    }
    mul(d, d, d);
  }
  printf("%.14lf\n", double(res[r - 1]));
  return 0;
}
