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

public class cheese_aa_wrong implements Runnable {

	public static void main(String[] args) {
		new Thread(new cheese_aa_wrong()).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;
			return l1 > l2 ? -1 : l1 < l2 ? 1 : n < j.n ? -1 : n > j.n ? 1 : 0;
		}
	}

	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<Pack> packs = new ArrayList<Pack>();
		long pt = 0;
		long ans = Long.MIN_VALUE;
		while (!release.isEmpty() || finish < Long.MAX_VALUE) {
			long t = Long.MAX_VALUE;
			if (!release.isEmpty() && release.first() < finish) {
				t = release.pollFirst();
			} else {
				t = finish;
			}
			finish = Long.MAX_VALUE;
			TreeSet<Job> ts = new TreeSet<Job>();
			for (Pack p : packs) {
				for (Job j : p.jobs) {
					j.p -= p.s * (t - pt);
					if (j.p > 0) {
						ts.add(j);
					} else {
						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]);
				}
			}
			packs.clear();
			ArrayList<Job> jobs = new ArrayList<Job>(ts);
			int prev = -1;
			for (int i = 0; i < jobs.size() + 1; i++) {
				if (i == 0
						|| i == jobs.size()
						|| jobs.get(i).p - jobs.get(i).d != jobs.get(i - 1).p
								- jobs.get(i - 1).d) {
					if (prev >= 0) {
						Pack p = new Pack(prev, i);
						long sum = 0;
						for (int j = prev; j < i; j++) {
							p.jobs.add(jobs.get(j));
							sum += s[j];
						}
						p.s = sum / (i - prev);
						p.level = jobs.get(prev).p - jobs.get(prev).d;
						packs.add(p);
					}
					prev = i;
				}
			}
			for (Pack p : packs) {
				if (p.s > 0) {
					for (Job j : p.jobs) {
						finish = Math.min(finish, t + (j.p + p.s - 1) / p.s);
					}
				}
			}
			// for (int i = 1; i < packs.size(); i++) {
			// long l1 = packs.get(i - 1).level;
			// long l2 = packs.get(i).level;
			// long s1 = packs.get(i - 1).s;
			// long s2 = packs.get(i).s;
			// if (s1 != s2) {
			// long tt = (l1 - l2) / (s1 - s2);
			// time.add(t + tt);
			// }
			// }
		}
		out.println(1.0 * Math.max(ans,0) / PREC);
	}

	class Pack {
		public Pack(int prev, int i) {
			l = prev;
			r = i;
			jobs = new ArrayList<Job>();
		}

		int l, r;
		long s;
		long level;
		ArrayList<Job> jobs;
	}
}
