Dune
题号:NC295147
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Colin recently watched the movie Dune: Part Two and was deeply impressed by the scene in which Paul Atreides summons and rides a giant sandworm!



Colin noticed that the timing of summoning sandworms is very important. There are always so many mysteries hidden under the calm dunes! Therefore, he modeled "Summoning Sandworms" and designed a problem for you:

To simplify the problem, we describe the topography of the dunes with a one-dimensional numerical axis. There are n sandworms moving parallel to the number axis. Specifically, at the initial time t=0, the body of the i-th sandworm can be described by the segment [l_i,r_i] (thus, the length of the i-th sandworm is r_i-l_i), and it will move in the positive direction of the number axis at a speed of v_i per second. That is, at time t, the body of the i-th worm can be described by the segment [l_i+v_i\times t,r_i+v_i\times t].

Your position is at coordinate x and you can choose any nonnegative real number time t' to summon sandworms passing through your position (i.e. at time t', the coordinate x\in [l_i+v_i\times t',r_i+v_i\times t'] ). However, there may be more than one sandworm passing through your position at this moment. In this case, you can only summon the shortest one among these sandworms.

There's nothing more exciting than summoning a giant sandworm! So Colin wants to know, what is the longest length of sandworm you can possibly summon.

输入描述:

The first line contains two integers n, x\ (1\le n\le 10^5, 0\le x\le 10^9), representing the number of sandworms and your position.

In the following n lines, each line contains three integers l_i,r_i,v_i\ (-10^9\le l_i\le r_i\le 10^9, 1\le v_i\le 10^9), describing the i-th sandworm.

It's guaranteed that at least one sandworm will pass by your position.

输出描述:

Output a single integer, representing the longest length of sandworm you can possibly summon.
示例1

输入

复制
4 3
4 1000000000 1
2 4 1
1 1000000000 1000000000
1 2 3

输出

复制
2