#include <bits/stdc++.h>
using namespace std;
const int L = 1 << 19;
char ibuf[L], *ie = ibuf + L, *ip = ie - 1;
inline char nc(void) {
  if (++ip == ie)
    if (fread(ip = ibuf, 1, L, stdin))
      ;
  return *ip;
}
inline int read(void) {
  char opt;
  int flag = 1, res = 0;
  while ((opt = getchar()) < '0')
    if (opt == '-') flag = -1;
  while (opt >= '0') {
    res = (res << 3) + (res << 1) + opt - '0';
    opt = getchar();
  }
  return res * flag;
}
struct edge {
  int x, y, v;
} e[101];
struct Edge {
  int y, v;
};
vector<Edge> v[101];
int n, m, t, rev[80001], dis[101], q[101 << 1], cost;
double f[101][20001], g[101][20001], p[101][20001];
char vis[101];
struct cp {
  double x, y;
  cp(double X = 0, double Y = 0) { x = X, y = Y; }
  inline cp operator+(cp a) { return cp(x + a.x, y + a.y); }
  inline cp operator-(cp a) { return cp(x - a.x, y - a.y); }
  inline cp operator/(double a) { return cp(x / a, y / a); }
  inline cp operator*(cp a) { return cp(x * a.x - y * a.y, x * a.y + y * a.x); }
} a[80001], b[80001];
inline void Getinv(int len) {
  int i;
  for (i = 0; i < len; ++i)
    rev[i] = (rev[i >> 1] >> 1) ^ ((i & 1) * (len >> 1));
}
inline void FFT(cp* c, int len, int flag) {
  int i, j, k, l;
  cp x, y, w, wn, t;
  for (i = 0; i < len; ++i)
    if (i < rev[i]) t = c[i], c[i] = c[rev[i]], c[rev[i]] = t;
  for (i = 1; i < len; i <<= 1) {
    wn = cp(cos(acos(-1) / i), flag * sin(acos(-1) / i));
    for (l = i << 1, j = 0; j < len; j += l) {
      for (w = cp(1, 0), k = 0; k < i; ++k, w = wn * w) {
        x = c[j + k], y = c[i + j + k] * w;
        c[j + k] = x + y, c[i + j + k] = x - y;
      }
    }
  }
  if (~flag) return;
  for (i = 0; i < len; ++i) c[i] = c[i] / len;
}
inline void SPFA(void) {
  int x, V, y, l = 0, r;
  fill(dis + 1, dis + n + 1, 0x3f3f3f3f);
  dis[q[r = 1] = n] = 0, vis[n] = 1;
  while (l < r) {
    vis[x = q[++l]] = 0;
    for (auto t : v[x]) {
      if (dis[y = t.y] > dis[x] + (V = t.v)) {
        dis[y] = dis[x] + V;
        if (!vis[y]) vis[q[++r] = y] = 1;
      }
    }
  }
}
inline void CDQ(int l, int r) {
  int i, j, len = 1, mid;
  if (l == r) {
    for (i = 1; i <= m; ++i) f[e[i].x][l] = min(f[e[i].x][l], g[i][l]);
    return;
  }
  mid = (l + r) >> 1;
  CDQ(mid + 1, r);
  while (len < (r - l)) len <<= 1;
  for (i = 1; i <= m; ++i) {
    for (j = 0; j < r - mid; ++j) a[j] = cp(f[e[i].y][j + mid + 1], 0);
    for (j = r - mid; j < len; ++j) a[j] = cp(0, 0);
    for (j = 0; j < r - l; ++j) b[j] = cp(p[i][t + l - r + j]);
    for (j = r - l; j < len; ++j) b[j] = cp(0, 0);
    Getinv(len);
    FFT(a, len, 1), FFT(b, len, 1);
    for (j = 0; j < len; ++j) a[j] = a[j] * b[j];
    FFT(a, len, -1);
    for (j = l; j <= mid; ++j) g[i][j] += a[j + (r - l) - (mid + 1)].x;
  }
  CDQ(l, mid);
}
int main(void) {
  int i, j, x, y, z;
  n = read(), m = read(), t = read(), cost = read();
  for (i = 1; i < n; ++i)
    for (j = 0; j <= t; ++j) f[i][j] = 1e18;
  for (i = 1; i <= m; ++i) {
    e[i] = {x = read(), y = read(), z = read()};
    v[y].push_back({x, z});
    for (j = 1; j <= t; ++j) p[i][j] = 1. * read() / 100000.;
    reverse(p[i], p[i] + t + 1);
    for (j = 1; j <= t; ++j) g[i][j] = g[i][j - 1] + p[i][j - 1];
  }
  SPFA();
  for (i = 1; i <= m; ++i)
    for (j = 0; j <= t; ++j) g[i][j] = g[i][j] * (cost + dis[e[i].y]) + e[i].v;
  CDQ(0, t);
  printf("%.8lf", f[1][0]);
  return 0;
}
