// * template

#include <bits/stdc++.h>
#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif

using namespace std;

// * solve

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(10);

	for(int n, m, k; cin >> n >> m >> k && n;) {
		vector<int> x(n);
		vector<double> forward(n), back(n);
		vector<double> dp(n + 1, 0.0);

		for(int i = 0; i < n; ++i) {
			int l, f, d, ud;
			cin >> x[i] >> l >> f >> d >> ud;
			if(ud == 1) {
				swap(f, d);
				dp[i] = static_cast<double>(l) / d;
			}

			forward[i] = static_cast<double>(l) / f;
			back[i] = static_cast<double>(l) / d;
		}

		vector<int> v(m);
		for(auto &e : v) cin >> e;

		double ans = INT_MIN;
		int prev_v = -1;

		for(int i = 0; i < m; ++i) {
			double t = 0.0;
			int pos = -i;

			for(int j = 0; j < n; ++j) {
				t = max(dp[j], t + static_cast<double>(x[j] - pos) / v[i]) + forward[j];
				dp[j] = t + max(back[j], 1.0 / v[i]);
				pos = x[j];
			}

			t += static_cast<double>(k - pos) / v[i];
			if(t < dp[n] + 1e-8) {
				t = dp[n];
			}
			else {
				prev_v = v[i];
			}

			ans = t;
			dp[n] = t + 1.0 / prev_v;
		}
		cout << ans << endl;
	}

	return EXIT_SUCCESS;
}