import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Locale;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class cheese_sm_wrong_longoverflow {
	final boolean DEBUG = false;

	class Job {
		long p, r, d;

		public Job(long p, long r, long d) {
			assert 1 <= p && p <= 1e5;
			assert 0 <= r && r < d && d <= 1e7;
			this.p = p;
			this.r = r;
			this.d = d;
		}

		@Override
		public String toString() {
			return "< p = " + p + ",  r = " + r + " d = " + d + ">";
		}

	}

	class Edge {
		Vertex to;
		long cap;
		long flow;
		Edge reverse;

		public Edge(Vertex to, long cap) {
			this.to = to;
			this.cap = cap;
			this.flow = 0;
		}

		@Override
		public String toString() {
			return "(to = " + to + "[" + flow + "/" + cap + "])";
		}
	}

	class Vertex {
		ArrayList<Edge> e;
		boolean u;

		public Vertex() {
			allVertex.add(this);
			e = new ArrayList<Edge>();
		}
	}

	boolean equals(long a, long b) {
		return a == b;
	}

	void addEdge(Vertex from, Vertex to, long cap) {
		Edge direct = new Edge(to, cap);
		Edge rev = new Edge(from, 0);
		direct.reverse = rev;
		rev.reverse = direct;
		from.e.add(direct);
		to.e.add(rev);
	}

	int n, m;
	Job[] jobs;
	long[] s;
	long S, P;
	ArrayList<Vertex> allVertex;
	Vertex source, sink;

	boolean can(long lat) {
		TreeSet<Long> t = new TreeSet<Long>();
		for (int i = 0; i < jobs.length; i++) {
			t.add((long) jobs[i].r);
			if (jobs[i].d + lat < jobs[i].r) {
				return false;
			}
			t.add(jobs[i].d + lat);
		}
		allVertex = new ArrayList<Vertex>();
		source = new Vertex();
		sink = new Vertex();
		Vertex[] J = new Vertex[n];
		for (int i = 0; i < J.length; i++) {
			J[i] = new Vertex();
			addEdge(source, J[i], jobs[i].p);
		}
		Long prev = null;
		for (long d : t) {
			if (prev == null) {
				prev = d;
				continue;
			}
			if (equals(prev, d)) {
				continue;
			}
			if (DEBUG)
				System.err.println("Ik = [" + prev + ", " + d + "]");
			Vertex Ik = new Vertex();
			long Tk = d - prev;
			addEdge(Ik, sink, S * (Tk));

			Vertex[] K = new Vertex[m];
			for (int j = 0; j < K.length; j++) {
				K[j] = new Vertex();
				addEdge(K[j], Ik, (j + 1) * (s[j] - s[j + 1]) * Tk);
			}
			for (int i = 0; i < J.length; i++) {
				for (int j = 0; j < K.length; j++) {
					if (jobs[i].r <= prev && d <= jobs[i].d + lat) {
						if (DEBUG)
							System.err.println(" can " + jobs[i].toString()
									+ " with lat = " + lat);
						addEdge(J[i], K[j], (s[j] - s[j + 1]) * (Tk));
					}
				}
			}
			prev = d;
		}

		long flow = 0;

		long max = P;
		while (max > 0) {
			while (true) {
				for (Vertex v : allVertex) {
					v.u = false;
				}
				long d = dfs(source, Long.MAX_VALUE, max);
				if (d < max) {
					break;
				}
				flow += d;

			}
			max /= 2;
		}
		if (DEBUG)
			System.err.println("flow = " + flow);
		if (DEBUG)
			System.err.println();

		if (equals(flow, P)) {
			return true;
		} else {
			return false;
		}
	}

	long dfs(Vertex v, long flowFromSource, long minEdge) {
		if (v == sink) {
			return flowFromSource;
		}
		v.u = true;
		for (Edge e : v.e) {
			if (e.cap - e.flow > minEdge && !e.to.u) {
				long q = dfs(e.to, Math.min(flowFromSource, e.cap - e.flow),
						minEdge);
				if (q > minEdge) {
					e.flow += q;
					e.reverse.flow -= q;
					return q;
				}
			}
		}
		return 0;
	}

	final long MUL = (long) 1e5;

	void solve() {
		n = nextInt();
		assert 1 <= n && n <= 30;
		m = nextInt();
		assert 1 <= m && m <= 30;
		jobs = new Job[n];
		P = 0;
		for (int i = 0; i < jobs.length; i++) {
			jobs[i] = new Job(MUL * nextInt(), MUL * nextInt(), MUL * nextInt());
			P += jobs[i].p;
		}
		s = new long[m + 1];
		// Add one fictive machine with s[m] = 0
		S = 0;
		for (int i = 0; i < s.length; i++) {
			s[i] = nextInt();
			S += s[i];
			assert 1 <= s[i] && s[i] <= 1e5;
		}
		for (int i = 0; i < s.length; i++) {
			for (int j = i + 1; j < s.length; j++) {
				if (s[i] < s[j]) {
					long tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		}
		// can(1000);
		// if (true)
		// return;
		long min = Long.MIN_VALUE / 100;
		long max = Long.MAX_VALUE / 100;
		while (max - min > 1) {
			if (DEBUG)
				System.err.println(min + " " + max);
			long lat = (min + max) / 2;
			if (can(lat)) {
				max = lat;
			} else {
				min = lat;
			}
		}
		out.printf(Locale.US, "%.10f", Math.max((max + 0.0) / MUL, 0));
	}

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;

	void run() {
		try {
			br = new BufferedReader(new FileReader("cheese.in"));
			out = new PrintWriter(new FileWriter("cheese.out"));
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

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

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

	public static void main(String[] args) {
		new cheese_sm_wrong_longoverflow().run();
	}
}
