// Arup Guha
// 1/30/2018
// Solution to 2017 MCPC Problem I: The Uncertainty of Politics

import java.util.*;

public class politics {

	public static int n;
	public static event[] list;

	public static void main(String[] args) {

		// Create the list of events.
		Scanner stdin = new Scanner(System.in);
		n = stdin.nextInt();
		list = new event[n];
		for (int i=0; i<n; i++) {
			int s = stdin.nextInt();
			int low = stdin.nextInt();
			int high = stdin.nextInt();
			list[i] = new event(s, low, high);
		}

		// This last result is easy.
		double[] dp = new double[n];
		dp[n-1] = 1;

		// Store running maxes going backwards.
		double[] max = new double[n];
		max[n-1] = 1;

		// Build the rest of the results.
		for (int i=n-2; i>=0; i--) {

			// Iterate to location where we can build off this event.
			int j = i+1;
			while (j < n && list[j].s < list[i].e1) j++;

			// Now put together expectation equation.
			int cur = list[i].e1-1;
			dp[i] = 1;
			while (j < n && cur < list[i].e2) {

				// Add in this contribution.
				int next = list[j].s;

				// Can't have this go beyond our range!!!
				if (next > list[i].e2) next = list[i].e2;

				// This is what we add in.
				dp[i] += list[i].mult()*(next-cur)*max[j];

				// These are redundant terms for us.
				while (j < n && list[j].s == next) j++;

				// Update cur.
				cur = next;
			}

			// We want the best of this choice and all afterwards...
			max[i] = Math.max(max[i+1], dp[i]);
		}

		// Ta da!
		System.out.println(max[0]);
	}
}

class event {

	public int s;
	public int e1;
	public int e2;

	public event(int mys, int low, int high) {
		s = mys;
		e1 = s + low;
		e2 = s + high;
	}

	public double mult() {
		return 1.0/(e2-e1+1);
	}
}