#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
const double pi = acos(-1.);
struct CD {
  double a, b;
  CD() {}
  CD(double a, double b) : a(a), b(b) {}
};
inline CD operator+(CD &a, CD &b) { return CD(a.a + b.a, a.b + b.b); }
inline CD operator-(CD &a, CD &b) { return CD(a.a - b.a, a.b - b.b); }
inline CD operator*(CD &a, CD &b) {
  return CD(a.a * b.a - a.b * b.b, a.b * b.a + a.a * b.b);
}
const int N = 80100;
int r[N], n, m, x, t;
int g[110][110];
CD tmp[N], P[N], Q[N];
double dp[60][N], E[110][N], p[N], q[N], sprob[110][N / 4], prob[110][N / 4];
int a[110], b[110], c[110], pp;
void rev(CD *a, int n) {
  r[0] = 0;
  for (int i = 1; i < n; i++)
    if (i & 1)
      r[i] = (r[i >> 1] >> 1) + (n >> 1);
    else
      r[i] = (r[i >> 1] >> 1);
  for (int i = 0; i < n; i++)
    if (r[i] < i) swap(a[r[i]], a[i]);
}
void dft(CD *a, int n, bool inv) {
  CD wi, w, u, v;
  rev(a, n);
  for (int m = 2; m <= n; m <<= 1) {
    double Arg = 2 * pi / m * (inv ? -1 : 1);
    wi = CD(cos(Arg), sin(Arg));
    for (int j = 0; j < n; j += m) {
      w = CD(1, 0);
      for (int k = j, k2 = j + m / 2; k2 < j + m; k++, k2++)
        u = a[k], v = a[k2] * w, a[k] = u + v, a[k2] = u - v, w = w * wi;
    }
  }
  if (inv)
    for (int j = 0; j < n; j++) a[j].a /= n;
}
vector<CD> qq[110][30];
double pmt[N];
void mul(int n, int j) {
  if (n < 32) {
    for (int i = 0; i < n; i++) pmt[i] = 0;
    for (int i = 0; i < n / 2; i++)
      if (p[i])
        for (int j = 0; j < n / 2; j++) pmt[i + j] += p[i] * q[j];
    for (int i = 0; i < n; i++) tmp[i] = CD(pmt[i], 0);
    return;
  }
  for (int i = 0; i < n; i++) P[i] = CD(p[i], 0);
  dft(P, n, 0);
  int r = 0;
  while ((1 << r) != n) r++;
  if (((int)(qq[j][r]).size()) == 0) {
    for (int i = 0; i < n; i++) Q[i] = CD(q[i], 0);
    dft(Q, n, 0);
    for (int i = 0; i < n; i++) qq[j][r].push_back(Q[i]);
  }
  for (int i = 0; i < n; i++) tmp[i] = P[i] * qq[j][r][i];
  dft(tmp, n, 1);
}
void solve(int l, int r) {
  if (l + 1 == r) {
    if (l == 0)
      for (int i = 1; i < n; i++) dp[i][0] = x + g[i][n];
    else {
      for (int i = 1; i < n; i++) dp[i][l] = 1e30;
      for (int i = 0; i < m; i++)
        if (b[i] != n)
          dp[a[i]][l] = min(
              dp[a[i]][l], E[i][l] + sprob[i][l + 1] * (x + g[b[i]][n]) + c[i]);
        else
          dp[a[i]][l] = min(
              dp[a[i]][l], E[i][l] + sprob[i][l + 1] * (x + g[b[i]][n]) + c[i]);
    }
    return;
  }
  if (l > t) return;
  int md = (l + r) >> 1;
  solve(l, md);
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < 2 * (r - l); i++) p[i] = q[i] = 0;
    for (int i = 0; i < md - l; i++) p[i] = dp[b[j]][i + l];
    for (int i = 0; i < r - l; i++) q[i] = prob[j][i];
    mul(2 * (r - l), j);
    for (int i = md; i < r; i++) E[j][i] = E[j][i] + tmp[i - l].a;
  }
  solve(md, r);
}
int main() {
  scanf("%d%d%d%d", &n, &m, &t, &x);
  for (int i = 1; i < n + 1; i++)
    for (int j = 1; j < n + 1; j++) g[i][j] = (i == j) ? 0 : (1 << 29);
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", a + i, b + i, c + i);
    g[a[i]][b[i]] = min(g[a[i]][b[i]], c[i]);
    for (int j = 1; j < t + 1; j++) scanf("%d", &pp), prob[i][j] = pp * 0.00001;
    for (int j = t + 1 - 1; j >= 0; j--)
      sprob[i][j] = sprob[i][j + 1] + prob[i][j];
  }
  for (int k = 1; k < n + 1; k++)
    for (int i = 1; i < n + 1; i++)
      for (int j = 1; j < n + 1; j++) g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
  int M = 1;
  while (M <= t) M *= 2;
  solve(0, M);
  printf("%.10f\n", dp[1][t]);
}
