#LC001. #A.红绿灯

#A.红绿灯

Title Description

There is a straight east-west main road in City C, which can be seen as a one-dimensional coordinate axis with the east as the positive direction. The westernmost coordinate of the road is (0,0)(0,0).

There are nn traffic lights on the road, and the coordinates of the ii-th traffic light are xix_i. The duration of the red light is rir_i, and the duration of the green light is g-i. Each traffic light works according to the pattern of "red light rir_i second, green light gig_i second". For example, if ri=5r_i=5, g.i=3g.i=3, then the ii th traffic light is a red light between 00 second and 55 second, switches to a green light between 55 second and 88 second, switches to a red light between 88 second and 1313 second, and so on.

When someone is preparing to drive east from the westernmost point of the road (at coordinates 00), their car has a speed limit uu. Before departure, they can fix the speed vv to any integer from 11 to uu (including 11 and uu), so that the car will maintain a speed of v×m/sv\times m/s after starting at 00 (excluding the starting time of the car, i.e. for any real number 00, the coordinates of the car at tt seconds of departure are vtvt), and cannot brake or accelerate.

If a car encounters a traffic light while it is at a red light, it will be penalized, but if it is at a green light or when the red light switches between green lights, it will not be penalized. Given that all traffic lights have just switched from green to red at the departure time of 00 , please calculate all feasible vehicle speeds vv so that the vehicle can safely pass through all traffic lights.

Input format

The first line contains two positive integers n,vn, v separated by spaces, representing the number of traffic lights and the maximum speed limit of the vehicle, respectively.

Next, there are nn rows, each containing three positive integers xi,ri,anddix_i, r_i, and d_i separated by spaces, representing the coordinates of the ii-th traffic light, the red light time, and the green light time, respectively. Ensure that the coordinates of any two traffic lights are not the same.

Output format

Output a line of all feasible vehicle speeds vv in ascending order, separated by a space between every two numbers. The data ensures at least one feasible vehicle speed.

Example

2 10
9 2 1
7 2 5
1 3

Example Description

If v=2v=2, a red light with coordinates of 99 will be encountered. If v4v \ge 4, a red light with coordinates of 77 will be encountered; Therefore, vv can only be 1.31.3.

Data scale and agreement

For data of 50%50\%,$1\le n\le 2,1\le u\le 10,1\le x_i\le 10,1\le r_i\le 10,1\le g_i\le 1e9$;

For data of 100%100\%, $1 \le n \le 10000, \le u \le 100, 1\le x_i\le 1e9, 1\le r_i\le 1e9,1\le g_i\le 1e9$.