#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const long long int INFLL = 0x3f3f3f3f3f3f3f3fll;
long long int getint() {
  long long int ret = 0;
  bool f = 0;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') f ^= 1;
  while (c >= '0' && c <= '9') {
    ret = ret * 10 + c - '0';
    c = getchar();
  }
  return f ? -ret : ret;
}
using namespace std;
const int MAXN = 50, MAXM = 100, MAXT = 20000, MAXF = 65536;
const double pi = acos(-1);
int n, m, t;
double fv[MAXN + 10][MAXT + 10];
double fe[MAXM + 10][MAXT + 10];
double P[MAXM + 10][MAXT + 10];
int cost[MAXM + 10], eu[MAXM + 10], ev[MAXM + 10], dis[MAXN + 10][MAXN + 10];
struct cplx {
  double x, y;
  cplx() {}
  cplx(double _x, double _y = 0) {
    x = _x;
    y = _y;
  }
  cplx operator+(const cplx &r) const { return cplx(x + r.x, y + r.y); }
  cplx operator-(const cplx &r) const { return cplx(x - r.x, y - r.y); }
  cplx operator*(const cplx &r) const {
    return cplx(x * r.x - y * r.y, x * r.y + y * r.x);
  }
  void operator/=(const int &n) {
    x /= n;
    y /= n;
  }
} tmp[MAXF + 10], a[MAXF + 10], b[MAXF + 10];
double r[MAXF + 10];
int N, lgN;
int rev(int a) {
  int ret = 0;
  for (int i = 0; i < lgN; ++i, a >>= 1) ret = ret << 1 | (a & 1);
  return ret;
}
void FFT(cplx a[], int flag) {
  for (int i = 0; i < N; ++i) tmp[rev(i)] = a[i];
  for (int len = 2; len <= N; len <<= 1) {
    cplx w = cplx(cos(2 * pi / len), flag * sin(2 * pi / len));
    int t = len >> 1;
    for (int i = 0; i < N; i += len) {
      cplx wn = 1;
      for (int j = 0; j < t; ++j) {
        cplx x = tmp[i + j], y = wn * tmp[i + j + t];
        tmp[i + j] = x + y;
        tmp[i + j + t] = x - y;
        wn = wn * w;
      }
    }
  }
  for (int i = 0; i < N; ++i) a[i] = tmp[i];
  if (flag == -1)
    for (int i = 0; i < N; ++i) a[i] /= N;
}
void multi() {
  if (N > 128) {
    FFT(a, 1);
    FFT(b, 1);
    for (int j = 0; j < N; ++j) a[j] = a[j] * b[j];
    FFT(a, -1);
  } else {
    memset(r, 0, N * sizeof(double));
    for (int i = 0; i < N; ++i)
      for (int j = 0; i + j < N; ++j) r[i + j] = r[i + j] + a[i].x * b[j].x;
    for (int i = 0; i < N; ++i) a[i].x = r[i];
  }
}
void solve(int L, int R) {
  if (L == R) {
    for (int i = 1; i <= m; ++i) fv[eu[i]][L] = min(fv[eu[i]][L], fe[i][L]);
    return;
  }
  int mid = (L + R) >> 1;
  solve(L, mid);
  N = 1;
  lgN = 0;
  while (N <= R - L) N <<= 1, ++lgN;
  for (int i = 1; i <= m; ++i) {
    memset(a, 0, N * sizeof(cplx));
    memset(b, 0, N * sizeof(cplx));
    for (int j = L; j <= mid; ++j) a[j - L] = fv[ev[i]][j];
    for (int j = 1; j <= R - L; ++j) b[j] = P[i][j];
    multi();
    for (int j = mid - L + 1; j <= R - L; ++j) fe[i][j + L] += a[j].x;
  }
  solve(mid + 1, R);
}
int main() {
  n = getint(), m = getint(), t = getint();
  int x = getint();
  memset(dis, 0x3f, sizeof dis);
  for (int i = 1; i <= m; ++i) {
    int u = getint(), v = getint(), w = getint();
    cost[i] = w;
    eu[i] = u;
    ev[i] = v;
    dis[u][v] = min(dis[u][v], w);
    for (int j = 1; j <= t; ++j) P[i][j] = getint() / 100000.0;
  }
  for (int i = 1; i <= n; ++i) dis[i][i] = 0;
  for (int k = 1; k <= n; ++k)
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
  for (int i = 1; i <= m; ++i)
    for (int j = 0; j <= t; ++j) fe[i][j] = cost[i];
  for (int i = 1; i < n; ++i)
    for (int j = 0; j <= t; ++j) fv[i][j] = INFLL;
  for (int i = 0; i <= t; ++i) fv[n][i] = 0;
  for (int i = 1; i < n; ++i) fv[i][0] = x + dis[i][n];
  for (int i = 1; i <= m; ++i) {
    double p = 0;
    for (int j = t; j >= 1; --j) {
      p += P[i][j];
      if (ev[i] != n)
        fe[i][j] += p * fv[ev[i]][0];
      else
        fe[i][j] += (p - P[i][j]) * x;
    }
  }
  solve(1, t);
  printf("%.10f\n", fv[1][t]);
}
