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

public class cheese_aa_greed implements Runnable {

	public static void main(String[] args) {
		new Thread(new cheese_aa_greed()).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(int x, int y, int z, int i) {
			p = x * PREC;
			r = y * PREC;
			d = z * PREC;
			n = i;
		}

		long p, r, d;
		int n;

		@Override
		public int compareTo(Job j) {
			if (p - d > j.p - j.d) {
				return -1;
			} else if (p - d < j.p - j.d) {
				return 1;
			} else {
				return 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");
		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) + "]"), inBounds(nextInt(), 0, TEN_MILLION, "r["
					+ (i + 1) + "]"), inBounds(nextInt(), 0, TEN_MILLION, "d["
					+ (i + 1) + "]"), 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 i = 0; i < s.length; i++) {
			s[i] = -inBounds(nextInt(), 1, ONE_HUNDRED_THOUSAND, "s[" + (i + 1)
					+ "]");
		}
		Arrays.sort(s);
		for (int i = 0; i < s.length; i++) {
			s[i] = -s[i];
		}
		Arrays.sort(a, new Comparator<Job>() {

			@Override
			public int compare(Job j1, Job j2) {
				return j1.r < j2.r ? -1 : 1;
			}
		});
		long[] p = new long[a.length];
		for (int i = 0; i < p.length; i++) {
			p[i] = a[i].p;
		}
		long left = -1L * ONE_HUNDRED_THOUSAND * TEN_MILLION;
		long right = 1L * ONE_HUNDRED_THOUSAND * TEN_MILLION;
		while (right - left > 1) {
			for (int i = 0; i < p.length; i++) {
				a[i].p = p[i];
			}
			long middle = (left + right) / 2;
			TreeSet<Long> time = new TreeSet<Long>();
			for (int i = 0; i < a.length; i++) {
				time.add(a[i].r);
				time.add(a[i].d + middle);
			}
			long[] t = new long[time.size()];
			{
				int k = 0;
				for (long x : time) {
					t[k++] = x;
				}
			}
			int k = 0;
			TreeSet<Job> ts = new TreeSet<Job>();
			long real = Long.MIN_VALUE;
			int done = 0;
			for (int tt = 0; tt + 1 < t.length; tt++) {
				while (k < a.length && a[k].r <= t[tt]) {
					ts.add(a[k++]);
				}
				ArrayList<Job> al = new ArrayList<Job>();
				for (int i = 0; i < s.length; i++) {
					if (!ts.isEmpty()) {
						Job j = ts.pollFirst();
						al.add(j);
						if (j.p <= s[i] * (t[tt + 1] - t[tt])) {
							real = Math.max(real, t[tt] + (j.p + s[i] - 1)
									/ s[i] - j.d);
							done++;
						}
						j.p -= s[i] * (t[tt + 1] - t[tt]);
					}
				}
				for (Job j : al) {
					if (j.p > 0) {
						ts.add(j);
					}
				}
			}
			if (done == n && real <= middle) {
				right = middle;
			} else {
				left = middle;
			}
		}
		out.println(1.0 * Math.max(right, 0) / PREC);
	}
}
