#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
bool BEG;
int n, T, Punish, m, w[105], e[105];
vector<int> E[55];
double pr[105][20005], f[55][20005], sp[105][20005], G[105][20005];
double Delta[25][20005], M[20005], U[55][65], R[65];
struct edge {
  int v, w, pre;
} RE[50005];
int dex, adj[55];
struct Comp {
  double re, im;
  Comp operator+(const Comp &A) const { return (Comp){re + A.re, im + A.im}; }
  Comp operator-(const Comp &A) const { return (Comp){re - A.re, im - A.im}; }
  Comp operator*(const Comp &A) const {
    return (Comp){re * A.re - im * A.im, re * A.im + im * A.re};
  }
} W[2][80005];
int N, rev[80005];
struct node {
  Comp a[80005];
  void fft(int f) {
    Comp x, y;
    for (int i = (int)0; i <= (int)N - 1; i++)
      if (i < rev[i]) swap(a[i], a[rev[i]]);
    for (int i = 1; i < N; i <<= 1)
      for (int j = 0, t = N / (i << 1); j < N; j += i << 1)
        for (int k = 0, l = 0; k < i; k++, l += t) {
          x = W[f][l] * a[j + k + i], y = a[j + k];
          a[j + k] = y + x;
          a[j + k + i] = y - x;
        }
    if (f)
      for (int i = (int)0; i <= (int)N - 1; i++) a[i].re /= N;
  }
} B[55], H;
bool END;
inline int IN() {
  int x = 0, f = 1;
  char ch = getchar();
  while ((ch != '-') && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') f = -f, ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + ch - '0', ch = getchar();
  return x * f;
}
int Q[100005], r, dis[55];
bool vis[55];
void spfa(int x) {
  memset(dis, 0x3f, sizeof dis);
  dis[Q[r = 1] = x] = Punish;
  vis[x] = 1;
  for (int U = (int)1; U <= (int)r; U++) {
    int u = Q[U];
    for (int i = adj[u]; i; i = RE[i].pre) {
      int v = RE[i].v;
      if (dis[u] + RE[i].w < dis[v]) {
        dis[v] = dis[u] + RE[i].w;
        if (!vis[v]) vis[Q[++r] = v] = 1;
      }
    }
    vis[u] = 0;
  }
  for (int i = (int)1; i <= (int)n; i++) f[i][0] = dis[i];
}
void pret(int n) {
  for (N = 1; N < n; N <<= 1)
    ;
  N <<= 1;
  for (int i = 0; i < N; i++) {
    int x = i, y = 0;
    for (int k = 1; k < N; k <<= 1, x >>= 1) (y <<= 1) |= x & 1;
    rev[i] = y;
  }
  for (int i = 0; i < N; i++) {
    W[1][i] = W[0][i] = (Comp){cos(2 * pi * i / N), sin(2 * pi * i / N)};
    W[1][i].im = -W[0][i].im;
  }
}
void conquer(int Lx, int Rx, int Dpt = 0) {
  if (Lx == Rx) {
    for (int i = (int)1; i <= (int)n; i++) {
      f[i][Lx] = 1e30;
      for (int j = (int)0; j <= (int)E[i].size() - 1; j++) {
        int v = e[E[i][j]], wx = w[E[i][j]], k = E[i][j];
        f[i][Lx] = min(f[i][Lx], G[k][Lx] + f[v][0] * sp[k][Lx] + wx);
      }
    }
    f[n][Lx] = 0;
    return;
  }
  int md = (Lx + Rx) >> 1;
  conquer(Lx, md, Dpt + 1);
  if (Rx - Lx + 1 > 32) pret(Rx - Lx + 2);
  for (int V = (int)1; V <= (int)n; V++) {
    if (Rx - Lx + 1 > 32) {
      for (int j = (int)0; j <= (int)N - 1; j++) B[V].a[j] = (Comp){0, 0};
      for (int i = (int)Lx; i <= (int)md; i++)
        B[V].a[i - Lx + 1] = (Comp){f[V][i], 0};
      B[V].fft(0);
    } else {
      for (int i = (int)0; i <= (int)Rx - Lx + 1; i++) U[V][i] = 0;
      for (int i = (int)Lx; i <= (int)md; i++) U[V][i - Lx + 1] = f[V][i];
    }
  }
  for (int i = (int)1; i <= (int)m; i++) {
    if (Rx - Lx + 1 > 32) {
      for (int j = (int)0; j <= (int)N - 1; j++) H.a[j] = (Comp){0, 0};
      for (int j = (int)1; j <= (int)Rx - Lx + 1; j++)
        H.a[j] = (Comp){pr[i][j], 0};
      H.fft(0);
      for (int j = (int)0; j <= (int)N - 1; j++) H.a[j] = H.a[j] * B[e[i]].a[j];
      H.fft(1);
      for (int j = (int)md + 1; j <= (int)Rx; j++)
        G[i][j] += (Delta[Dpt][j] = H.a[j - Lx + 1].re);
    } else {
      for (int j = (int)0; j <= (int)Rx - Lx + 1; j++) {
        M[j] = 0;
        R[j] = pr[i][j];
      }
      for (int j = (int)0; j <= (int)Rx - Lx + 1; j++)
        for (int k = (int)0; k <= (int)Rx - Lx + 1; k++) {
          if (j + k > Rx - Lx + 1) break;
          M[j + k] += U[e[i]][j] * R[k];
        }
      for (int j = (int)md + 1; j <= (int)Rx; j++)
        G[i][j] += (Delta[Dpt][j] = M[j - Lx + 1]);
    }
  }
  conquer(md + 1, Rx, Dpt + 1);
  for (int i = (int)1; i <= (int)m; i++)
    for (int j = (int)md + 1; j <= (int)Rx; j++) G[i][j] -= Delta[Dpt][j];
}
int main() {
  n = IN(), m = IN(), T = IN(), Punish = IN();
  for (int i = (int)1; i <= (int)m; i++) {
    int x = IN(), y = IN(), we = IN();
    e[i] = y;
    w[i] = we;
    E[x].push_back(i);
    RE[++dex] = (edge){x, we, adj[y]};
    adj[y] = dex;
    for (int j = (int)1; j <= (int)T; j++) pr[i][j] = IN() / 100000.;
    for (int j = (int)T; j >= (int)1; j--) sp[i][j] = sp[i][j + 1] + pr[i][j];
  }
  spfa(n);
  conquer(1, T + 1);
  printf("%.10lf\n", (double)f[1][T + 1]);
  return 0;
}
