#include <bits/stdc++.h>
using namespace std;
long long pwr(long long base, long long p, long long mod = (1000000007LL)) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    p /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
struct base {
  double x, y;
  base() { x = y = 0; }
  base(double _x, double _y) { x = _x, y = _y; }
  base(double _x) { x = _x, y = 0; }
  void operator=(double _x) { x = _x, y = 0; }
  double real() { return x; }
  double imag() { return y; }
  base operator+(const base& b) { return base(x + b.x, y + b.y); }
  void operator+=(const base& b) { x += b.x, y += b.y; }
  base operator*(const base& b) {
    return base(x * b.x - y * b.y, x * b.y + y * b.x);
  }
  void operator*=(const base& b) {
    double p = x * b.x - y * b.y, q = x * b.y + y * b.x;
    x = p, y = q;
  }
  void operator/=(double k) { x /= k, y /= k; }
  base operator-(const base& b) { return base(x - b.x, y - b.y); }
  void operator-=(const base& b) { x -= b.x, y -= b.y; }
};
const double PI = 4 * atan(1);
const int LG = 19;
const int maxn = (1 << LG);
base W[maxn >> 1], invW[maxn >> 1];
void precompute_powers() {
  for (int i = 0; i < maxn / 2; i++) {
    double ang = (2 * PI * i) / maxn;
    double _cos = cos(ang), _sin = sin(ang);
    W[i] = base(_cos, _sin);
    invW[i] = base(_cos, -_sin);
  }
}
void fft(vector<base>& a, bool invert) {
  int n = (int)a.size();
  for (int i = 1, j = 0; i < n; ++i) {
    int bit = n >> 1;
    for (; j >= bit; bit >>= 1) j -= bit;
    j += bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (int len = 2; len <= n; len <<= 1) {
    for (int i = 0; i < n; i += len) {
      int ind = 0, add = maxn / len;
      for (int j = 0; j < len / 2; ++j) {
        base u = a[i + j],
             v = (a[i + j + len / 2] * (invert ? invW[ind] : W[ind]));
        a[i + j] = (u + v);
        a[i + j + len / 2] = (u - v);
        ind += add;
      }
    }
  }
  if (invert)
    for (int i = 0; i < n; ++i) a[i] /= n;
}
const int N = 52, M = 101, TMAX = 200002;
int n, e, T, X, dist[N];
vector<pair<pair<int, int>, int> > edge_list;
vector<vector<double> > probs;
vector<pair<int, int> > rev_adj[N];
vector<int> adj[N];
double DP_V[N][TMAX], DP_E[M][TMAX], tot_prob[M];
void convolve(int l1, int r1, int l2, int r2, int e) {
  if (l1 > r1 || l2 > r2) return;
  int v = edge_list[e].first.second, sz1 = r1 - l1 + 1, sz2 = r2 - l2 + 1;
  int sz = sz1 + sz2 - 1;
  int n = 1;
  while (n < sz) n *= 2;
  vector<base> A(n, 0), B(n, 0);
  for (int i = l1; i <= r1; i++) A[i - l1] = DP_V[v][i];
  for (int i = l2; i <= r2; i++) B[i - l2] = probs[e][i];
  fft(A, false);
  fft(B, false);
  for (int i = 0; i < n; i++) A[i] *= B[i];
  fft(A, true);
  for (int i = 0; i < sz; i++) {
    int idx = l1 + l2 + i;
    if (idx <= T) DP_E[e][idx] += A[i].x;
  }
}
int main() {
  precompute_powers();
  scanf("%d%d%d%d", &n, &e, &T, &X);
  edge_list.resize(e);
  probs.resize(e);
  for (int i = 0; i < e; i++) {
    scanf("%d%d%d", &edge_list[i].first.first, &edge_list[i].first.second,
          &edge_list[i].second);
    adj[edge_list[i].first.first].push_back(i);
    probs[i].resize(T + 1);
    probs[i][0] = 0.0;
    for (int t = 1; t <= T; t++) {
      scanf("%lf", &probs[i][t]);
      probs[i][t] /= 100000.00;
    }
    tot_prob[i] = 1.0;
    rev_adj[edge_list[i].first.second].push_back(
        pair<int, int>(edge_list[i].first.first, edge_list[i].second));
  }
  for (int i = 1; i <= n; i++) dist[i] = (1000000007LL);
  priority_queue<pair<int, int> > pq;
  dist[n] = 0;
  pq.push(pair<int, int>(0, n));
  while (!pq.empty()) {
    int v = pq.top().second;
    int d = -pq.top().first;
    pq.pop();
    if (d > dist[v]) continue;
    for (auto it : rev_adj[v]) {
      int vv = it.first, dd = d + it.second;
      if (dd < dist[vv]) {
        dist[vv] = dd;
        pq.push(pair<int, int>(-dd, vv));
      }
    }
  }
  for (int i = 1; i <= n - 1; i++) DP_V[i][0] = dist[i] + X;
  DP_V[n][0] = 0;
  for (int j = 0; j < e; j++) {
    int b = edge_list[j].first.second;
    DP_E[j][1] += DP_V[b][0] * probs[j][1];
    DP_E[j][2] += DP_V[b][0] * probs[j][2];
  }
  for (int t = 1; t <= T; t++) {
    for (int j = 0; j < e; j++) {
      tot_prob[j] -= probs[j][t];
      int c = edge_list[j].second, b = edge_list[j].first.second;
      DP_E[j][t] += c + tot_prob[j] * (dist[b] + X);
    }
    for (int i = 1; i <= n - 1; i++) {
      DP_V[i][t] = 1e10;
      for (auto it : adj[i]) DP_V[i][t] = min(DP_V[i][t], DP_E[it][t]);
    }
    DP_V[n][t] = 0.0;
    for (int j = 0; j < e; j++) {
      int b = edge_list[j].first.second;
      if (t + 1 <= T) DP_E[j][t + 1] += DP_V[b][t] * probs[j][1];
      if (t + 2 <= T) DP_E[j][t + 2] += DP_V[b][t] * probs[j][2];
      for (int p = 2; t % p == 0 && p + 1 <= T; p *= 2) {
        convolve(t - p, t - 1, p + 1, min(T, 2 * p), j);
      }
    }
  }
  printf("%.7lf\n", DP_V[1][T]);
  return 0;
}
