#include <bits/stdc++.h>
using namespace std;
const int N = 55, M = 105, T = 20005, S = 1 << 15;
const double pi = acos(-1.0);
int n, m, t, P, s, d, R[S], a[M], b[M], c[M], dis[N][N];
double dp[N][T], sum[M][T], p[M][T];
struct C {
  double x, y;
} A[S], B[S];
inline C operator+(const C& a, const C& b) { return (C){a.x + b.x, a.y + b.y}; }
inline C operator-(const C& a, const C& b) { return (C){a.x - b.x, a.y - b.y}; }
inline C operator*(const C& a, const C& b) {
  return (C){a.x * b.x - a.y * b.y, a.y * b.x + a.x * b.y};
}
inline void fft(C* a, int n, int f) {
  for (int i = 0; i < n; i++)
    if (i < R[i]) swap(a[i], a[R[i]]);
  for (int i = 2; i <= n; i <<= 1) {
    C wn = (C){cos(2.0 * pi / i), f * sin(2.0 * pi / i)};
    for (int j = 0; j < n; j += i) {
      C w = (C){1, 0};
      for (int k = 0; k < (i >> 1); k++, w = w * wn) {
        C u = a[j + k], v = a[j + k + (i >> 1)] * w;
        a[j + k] = u + v;
        a[j + k + (i >> 1)] = u - v;
      }
    }
  }
  if (f == -1)
    for (int i = 0; i < n; i++) a[i].x /= n;
}
void sol(int l, int r) {
  if (l == r) {
    for (int e = 1; e <= m; e++)
      dp[a[e]][l] = min(dp[a[e]][l], sum[e][l] + c[e]);
    return;
  }
  int mid = l + r >> 1;
  sol(mid + 1, r);
  for (s = 1, d = 0; s < r - mid + r - l; s <<= 1, d++)
    ;
  for (int i = 0; i < s; i++) R[i] = R[i >> 1] >> 1 | (i & 1) << (d - 1);
  for (int e = 1; e <= m; e++) {
    for (int i = 0; i < s; i++) A[i] = B[i] = (C){0, 0};
    for (int i = mid + 1; i <= r; i++) A[i - mid - 1] = (C){dp[b[e]][i], 0};
    for (int i = 1; i <= r - l; i++) B[r - l - i] = (C){p[e][i], 0};
    fft(A, s, 1);
    fft(B, s, 1);
    for (int i = 0; i < s; i++) A[i] = A[i] * B[i];
    fft(A, s, -1);
    for (int i = l; i <= mid; i++) sum[e][i] += A[i - mid - 1 + r - l].x;
  }
  sol(l, mid);
}
int main() {
  scanf("%d%d%d%d", &n, &m, &t, &P);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) dis[i][j] = i == j ? 0 : 1e9;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &a[i], &b[i], &c[i]);
    dis[a[i]][b[i]] = min(dis[a[i]][b[i]], c[i]);
    for (int j = 1; j <= t; j++) scanf("%lf", &p[i][j]), p[i][j] /= 100000;
  }
  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 = 0; i < N; i++)
    for (int j = 0; j < T; j++) dp[i][j] = 1e9;
  for (int i = 1; i <= n; i++) dp[i][t + 1] = P + dis[i][n];
  for (int i = 0; i <= t; i++) dp[n][i] = 0;
  for (int e = 1; e <= m; e++) {
    double s = 0;
    for (int i = 1; i <= t; i++)
      s += p[e][t - i + 1], sum[e][i] += s * dp[b[e]][t + 1];
  }
  sol(0, t);
  printf("%.8lf\n", dp[1][0]);
  return 0;
}
