import java.io.*;
import java.util.*;
import java.math.*;

public class cheese_aa_wrong2 implements Runnable {

	public static void main(String[] args) {
		new Thread(new cheese_aa_wrong2()).start();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;
	Random rand = new Random(this.hashCode());

	@Override
	public void run() {
		long time = System.currentTimeMillis();
		Locale.setDefault(Locale.US);
		try {
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(566);
		}
		// System.out.println((System.currentTimeMillis() - time) / 1000.0);
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	void myAssert(boolean u, String message) {
		if (!u) {
			throw new Error("Assertion failed!!! " + message);
		}
	}

	int inBounds(int x, int l, int r, String name) {
		myAssert(l <= x && x <= r, name + " not in bounds!!! " + x
				+ " not in [" + l + ".." + r + "]");
		return x;
	}

	String FNAME = "cheese";

	final static int ONE_HUNDRED_THOUSAND = 100000;
	final static int TEN_MILLION = 10000000;
	final static long PREC = 100000;
	final static int MAX = 30;

	class Job implements Comparable<Job> {
		public Job(long p2, long r2, long d2, int i) {
			p = p2;
			r = r2;
			d = d2;
			n = i;
		}

		long p, r, d;
		int n;

		@Override
		public int compareTo(Job j) {
			long l1 = p - d;
			long l2 = j.p - j.d;
			if (l1 == l2) {
				if (p == j.p) {
					return n < j.n ? -1 : n > j.n ? 1 : 0;
				}
				return p < j.p ? -1 : 1;
			}
			return l1 > l2 ? -1 : 1;
		}
	}

	private void solve() throws IOException {
		int n = inBounds(nextInt(), 1, MAX, "n");
		int m = inBounds(nextInt(), 1, MAX, "m") + n;
		Job[] a = new Job[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = new Job(inBounds(nextInt(), 1, ONE_HUNDRED_THOUSAND, "p["
					+ (i + 1) + "]")
					* PREC, inBounds(nextInt(), 0, TEN_MILLION, "r[" + (i + 1)
					+ "]")
					* PREC, inBounds(nextInt(), 0, TEN_MILLION, "d[" + (i + 1)
					+ "]")
					* PREC, i);
			myAssert(a[i].r < a[i].d, "due before release for " + (i + 1)
					+ ": r = " + a[i].r / PREC + " d = " + a[i].d / PREC);
		}
		long[] s = new long[m];
		for (int j = 0; j + n < s.length; j++) {
			s[j] = -inBounds(nextInt(), 1, ONE_HUNDRED_THOUSAND, "s[" + (j + 1)
					+ "]");
		}
		Arrays.sort(s);
		for (int j = 0; j < s.length; j++) {
			s[j] = -s[j];
		}
		TreeSet<Long> release = new TreeSet<Long>();
		long finish = Long.MAX_VALUE;
		for (int i = 0; i < a.length; i++) {
			release.add(a[i].r);
		}
		ArrayList<Job> jobs = new ArrayList<Job>();
		long pt = 0;
		long ans = Long.MIN_VALUE;
		while (!release.isEmpty() || finish < Long.MAX_VALUE) {
			// System.out.println(release);
			// System.out.println(finish);
			long t = Long.MAX_VALUE;
			if (!release.isEmpty() && release.first() < finish) {
				t = release.pollFirst();
			} else {
				t = finish;
			}
			TreeSet<Job> ts = new TreeSet<Job>();
			for (int i = 0; i < jobs.size(); i++) {
				Job j = jobs.get(i);
				j.p -= s[i] * (t - pt);
				if (j.p <= 0) {
					ans = Math.max(ans, t - j.d);
				}
			}
			pt = t;
			for (int i = 0; i < a.length; i++) {
				if (a[i].p > 0 && a[i].r <= t) {
					ts.add(a[i]);
				}
			}
			jobs = new ArrayList<Job>(ts);
			finish = Long.MAX_VALUE;
			for (int i = 0; i < jobs.size(); i++) {
				if (s[i] > 0) {
					Job j = jobs.get(i);
					finish = Math.min(finish, t + (j.p + s[i] - 1) / s[i]);
				}
			}
		}
		out.println(1.0 * Math.max(ans, 0) / PREC);
	}

}
