#include <bits/stdc++.h>
using namespace std;
namespace io {
const int SI = 1 << 21 | 1;
char IB[SI], *IS, *IT, OB[SI], *OS = OB, *OT = OS + SI - 1, c, ch[100];
int f, t;
inline void flush() { fwrite(OB, 1, OS - OB, stdout), OS = OB; }
inline void pc(char x) {
  *OS++ = x;
  if (OS == OT) flush();
}
template <class I>
inline void rd(I &x) {
  for (f = 1, c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),
                              IS == IT ? EOF : *IS++)
                            : *IS++);
       c < '0' || c > '9';
       c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),
                       IS == IT ? EOF : *IS++)
                     : *IS++))
    if (c == '-') f = -1;
  for (x = 0; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + (c & 15),
      c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),
                      IS == IT ? EOF : *IS++)
                    : *IS++))
    ;
  x *= f;
}
inline void rds(char *s, int &x) {
  for (c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),
                       IS == IT ? EOF : *IS++)
                     : *IS++);
       c < 33 || c > 126;
       c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),
                       IS == IT ? EOF : *IS++)
                     : *IS++))
    ;
  for (x = 0; c >= 33 && c <= 126;
       s[++x] = c, c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),
                                   IS == IT ? EOF : *IS++)
                                 : *IS++))
    ;
  s[x + 1] = '\0';
}
template <class I>
inline void print(I x, char k = '\n') {
  if (!x) pc('0');
  if (x < 0) pc('-'), x = -x;
  while (x) ch[++t] = x % 10 + '0', x /= 10;
  while (t) pc(ch[t--]);
  pc(k);
}
inline void prints(string s) {
  int x = s.length();
  while (t < x) pc(s[t++]);
  pc('\n'), t = 0;
}
struct Flush {
  ~Flush() { flush(); }
} flusher;
}  // namespace io
using io::print;
using io::prints;
using io::rd;
using io::rds;
namespace FFT {
const int N = 1 << 21 | 1;
const double PI = acos(-1);
struct I {
  double x, y;
  inline I() {}
  inline I(double x, double y) : x(x), y(y) {}
  inline I &operator=(int o) { return x = o, y = 0, *this; }
  inline I &operator=(double o) { return x = o, y = 0, *this; }
  inline I operator+(const I o) const { return I(x + o.x, y + o.y); }
  inline I operator-(const I o) const { return I(x - o.x, y - o.y); }
  inline I operator*(const I o) const {
    return I(x * o.x - y * o.y, x * o.y + y * o.x);
  }
} a[N], b[N];
inline void rd(I &x) {
  int o;
  ::rd(o), x = o;
}
inline void print(I x, char k = '\n') { ::print((int)(x.x + 0.5), k); }
int n, m, k, l, r[N];
inline void fft(I *a, int n, int x) {
  for (int i = 0; i < n; i++)
    if (i < r[i]) swap(a[i], a[r[i]]);
  for (int o = 2, k = 1; o <= n; o <<= 1, k <<= 1) {
    I W = I(cos(PI / k), x * sin(PI / k));
    for (int i = 0; i < n; i += o) {
      I w = I(1, 0);
      for (int j = 0; j < k; j++, w = w * W) {
        I x = a[i + j], y = w * a[i + j + k];
        a[i + j] = x + y, a[i + j + k] = x - y;
      }
    }
  }
}
inline void solve() {
  k = 1, l = 0;
  while (k <= n + m) k <<= 1, ++l;
  for (int i = 0; i < k; i++) r[i] = (r[i >> 1] >> 1) | ((i & 1) << (l - 1));
  for (int i = n + 1; i < k; i++) a[i] = 0;
  for (int i = m + 1; i < k; i++) b[i] = 0;
  fft(a, k, 1), fft(b, k, 1);
  for (int i = 0; i < k; i++) a[i] = a[i] * b[i];
  fft(a, k, -1);
  for (int i = 0; i <= n + m; i++) a[i].x /= k;
}
}  // namespace FFT
const int N = 53, M = 107, T = 2e4 + 7;
const double inf = 1e18;
int n, m, t, x, a[M], b[M];
double d[N][N], c[M], p[M][T * 2], f[N][T * 2], g[M][T];
void cdq(int l, int r) {
  if (l == t) return;
  if (l == r) {
    for (int i = 1; i < n; i++) f[i][l] = inf;
    for (int i = 1; i <= m; i++)
      if (a[i] != n) f[a[i]][l] = min(f[a[i]][l], g[i][l] + c[i]);
    return;
  }
  int mid = (l + r) >> 1;
  cdq(mid + 1, r);
  FFT::n = r - l - 1, FFT::m = r - mid - 1;
  for (int i = 1; i <= m; i++)
    if (a[i] != n) {
      for (int j = 0; j <= FFT::n; j++) FFT::a[j] = p[i][j + 1];
      for (int j = 0; j <= FFT::m; j++) FFT::b[j] = f[b[i]][r - j];
      FFT::solve();
      for (int j = l; j <= mid; j++) g[i][j] += FFT::a[r - j - 1].x;
    }
  cdq(l, mid);
}
int main() {
  rd(n), rd(m), rd(t), rd(x);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j) d[i][j] = inf;
  for (int i = 1, x; i <= m; i++) {
    rd(a[i]), rd(b[i]), rd(x), c[i] = d[a[i]][b[i]] = x;
    for (int j = 1; j <= t; j++) rd(x), p[i][j] = x / 1e5;
  }
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
  for (int i = 0; i < 2 * t; i++) f[n][i] = i <= t ? 0 : x;
  for (int i = 1; i < n; i++)
    for (int j = t; j < 2 * t; j++) f[i][j] = d[i][n] + x;
  cdq(0, 2 * t - 1);
  printf("%.10f\n", f[1][0]);
  return 0;
}
