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

public class cheese_aa_mh implements Runnable {

	public static void main(String[] args) {
		new Thread(new cheese_aa_mh()).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 Graph {

		class Edge {
			Vertex x, y;
			long c, f;
			Edge r;

			public Edge(Vertex x, Vertex y, long c) {
				this.x = x;
				this.y = y;
				this.c = c;
				f = 0;
			}
		}

		class Vertex {
			long exc;
			int h;
			boolean internal;
			int cur;
			ArrayList<Edge> edges;

			public Vertex() {
				edges = new ArrayList<Edge>();
			}

			public boolean discharge() {
				while (exc > 0 && cur < edges.size()) {
					Edge e = edges.get(cur);
					if (e.c > e.f && e.y.h + 1 == h) {
						long d = Math.min(exc, e.c - e.f);
						e.y.exc += d;
						exc -= d;
						e.f += d;
						e.r.f -= d;
						if (e.y.exc == d && e.y.internal) {
							q[e.y.h].add(e.y);
						}
					}
					if (exc > 0) {
						cur++;
					}
				}
				if (cur >= edges.size()) {
					cur = 0;
					lift();
					return true;
				}
				return false;
			}

			private void lift() {
				int nh = 2 * vertex.length - 1;
				for (Edge e : edges) {
					if (e.c > e.f) {
						nh = Math.min(nh, e.y.h + 1);
					}
				}
				h = nh;
			}
		}

		Vertex[] vertex;

		public Graph(int n) {
			vertex = new Vertex[n];
			for (int i = 0; i < vertex.length; i++) {
				vertex[i] = new Vertex();
			}
		}

		public void addEdge(int x, int y, long c) {
			Edge e = new Edge(vertex[x], vertex[y], c);
			Edge er = new Edge(vertex[y], vertex[x], 0);
			e.r = er;
			er.r = e;
			vertex[x].edges.add(e);
			vertex[y].edges.add(er);
		}

		LinkedList<Vertex>[] q;

		@SuppressWarnings("unchecked")
		public long maxFlow(int s, int t) {
			q = new LinkedList[vertex.length];
			for (int i = 0; i < q.length; i++) {
				q[i] = new LinkedList<Vertex>();
			}
			vertex[s].h = vertex.length;
			for (int i = 0; i < vertex.length; i++) {
				if (i != s && i != t) {
					q[0].add(vertex[i]);
					vertex[i].internal = true;
				}
			}
			for (Edge e : vertex[s].edges) {
				e.y.exc += e.c;
				e.f += e.c;
				e.r.f -= e.c;
			}
			int qmax = 0;
			long time = 0;
			int iter = 0;
			while (0 <= qmax && qmax < q.length) {
				for (Iterator<Vertex> it = q[qmax].iterator(); it.hasNext();) {
					Vertex v = it.next();
					if (v.discharge()) {
						it.remove();
						if (v.h < q.length) {
							qmax = v.h;
							q[v.h].add(v);
						}
						break;
					} else {
						it.remove();
					}
				}
				time -= System.currentTimeMillis();
				while (qmax >= 0 && q[qmax].size() == 0) {
					qmax--;
				}
				time += System.currentTimeMillis();
				iter++;
				if (iter % 1000000 == 0) {
					System.out.println(iter + " " + qmax);
				}
			}
			// System.out.println(time / 1000.0);
			return vertex[t].exc;
		}
	}

	private void solve() throws IOException {
		int n = inBounds(nextInt(), 1, MAX, "n");
		int m = inBounds(nextInt(), 1, MAX, "m");
		long[] p = new long[n];
		long[] r = new long[n];
		long[] d = new long[n];
		long sp = 0;
		long left = -1L * TEN_MILLION * ONE_HUNDRED_THOUSAND;
		long right = 1L * TEN_MILLION * ONE_HUNDRED_THOUSAND;
		for (int i = 0; i < d.length; i++) {
			p[i] = inBounds(nextInt(), 1, ONE_HUNDRED_THOUSAND, "p[" + (i + 1)
					+ "]")
					* PREC;
			sp += p[i];
			r[i] = inBounds(nextInt(), 0, TEN_MILLION, "r[" + (i + 1) + "]")
					* PREC;
			d[i] = inBounds(nextInt(), 0, TEN_MILLION, "d[" + (i + 1) + "]")
					* PREC;
			myAssert(r[i] < d[i], "due before release for " + (i + 1)
					+ ": r = " + r[i] / PREC + " d = " + d[i] / PREC);
		}
		long[] s = new long[m];
		for (int j = 0; j < s.length; j++) {
			s[j] = -inBounds(nextInt(), 1, ONE_HUNDRED_THOUSAND, "s[" + (j + 1)
					+ "]");
		}
		Arrays.sort(s);
		long sum = 0;
		for (int i = 0; i < s.length; i++) {
			s[i] = -s[i];
			sum += s[i];
		}
		while (right - left > 1) {
			long middle = (left + right) / 2;
			// System.out.println(middle);
			TreeSet<Long> ts = new TreeSet<Long>();
			for (int i = 0; i < p.length; i++) {
				ts.add(r[i]);
				ts.add(d[i] + middle);
			}
			long[] t = new long[ts.size()];
			{
				int k = 0;
				for (long x : ts) {
					t[k++] = x;
				}
			}
			Graph g = new Graph(1 + n + m * (t.length - 1) + t.length - 1 + 1);
			for (int i = 0; i < p.length; i++) {
				g.addEdge(0, i + 1, p[i]);
				for (int k = 0; k + 1 < t.length; k++) {
					if (r[i] <= t[k] && t[k + 1] <= d[i] + middle) {
						int sh = n + 1 + k * m;
						for (int j = 0; j < s.length; j++) {
							long c = (s[j] - (j + 1 < s.length ? s[j + 1] : 0))
									* (t[k + 1] - t[k]);
							myAssert(c >= 0, "Negative capacity!!!");
							g.addEdge(i + 1, sh + j, c);
						}
					}
				}
			}
			for (int k = 0; k + 1 < t.length; k++) {
				int sh = n + 1 + k * m;
				for (int j = 0; j < s.length; j++) {
					long c = (j + 1)
							* (s[j] - (j + 1 < s.length ? s[j + 1] : 0))
							* (t[k + 1] - t[k]);
					myAssert(c >= 0, "Negative capacity!!!");
					g.addEdge(sh + j, 1 + n + m * (t.length - 1) + k, c);
				}
				g.addEdge(1 + n + m * (t.length - 1) + k, 1 + n + m
						* (t.length - 1) + t.length - 1, sum
						* (t[k + 1] - t[k]));
				myAssert(sum * (t[k + 1] - t[k]) >= 0, "Negative capacity!!!");
			}
			long flow = g.maxFlow(0, 1 + n + m * (t.length - 1) + t.length - 1);
			if (flow == sp) {
				right = middle;
			} else {
				left = middle;
			}
		}
		out.println(1.0 * Math.max(right, 0) / PREC);
	}
}
