loop {
	n, l = gets.split.map &:to_i
	break if n == 0

	schedule = [0] * 86401
	(1..n).each {
		s, t, u = gets.split.map &:to_i
		(s..t-1).each{|i|
			schedule[i] = u
		}
	}


	events = []
	w = 0
	(0..86400).each{|i|
		if i > 0 && schedule[i] != schedule[i-1]
			events << [i, w]
			w = 0
		end
		
		w += schedule[i]		
	}

	events << [86400, 0]
	check = -> pump {
		w = l
		log = []
		2.times {
			t0 = 0
			events.each{|t, c|
				w += pump * (t - t0) - c
				return false if w < 0
				w = l if w > l
				t0 = t
			}
			log << w
		}
		return log[0] == log[1]
	}

	min = 0
	max = events.map(&:last).inject(:+)

	until (max - min).abs < 0.0000001
		c = (min + max) / 2.0
		if check[c]
			max = c
		else
			min = c
		end
	end
	printf("%.7f\n", min)
}