Final Exam

아직 제출이 없습니다시간 제한12초메모리 제한256 MB

문제

Rikka is a talented student.

She spends almost every day on ICPC. But the final exam is approaching. 

Rikka plans to grasp- the last minute to review the courses before the exam. She has up to MM minutes for review and then takes nn consecutive exams. If Rikka spends xx minutes on the review for the ii-th exam, she would get f_i(x)f\_i (x) points, where f_i(x)=max0,mind_i,a_ix2+b_ix+c_if\_i (x) = \max \\{0, \min \\{d\_i, a\_i x^2 + b\_i x + c\_i\\}\\} with the exam-specific parameters a_i,b_i,c_i,d_ia\_i, b\_i, c\_i, d\_i.

Rikka wants to maximize the total score of her nn exams. Note the minutes she spends in reviewing a certain course can be any non-negative real number. Also, she does not have to spend all of her MM minutes on the review so that she can spend more time on ICPC.

입력

The first line contains an integer nn and a real number MM.

Each of the following nn lines contains four real numbers a_i,b_i,c_i,d_ia\_i, b\_i, c\_i, d\_i, denoting the parameters of all the nn exams.

It is guaranteed that 1n100,0001 \le n \le 100\\,000, 0<M1080 < M \le 10^8, a_i10|a\_i| \le 10, b_i5000|b\_i| \le 5000, 0c_id_i50000 \le c\_i \le d\_i \le 5000, and all real numbers in the input are given with exactly three decimal places.

It is guaranteed that there are at most 1818 exams with a_i>0a\_i > 0.

출력

You need to output dd, the maximum total score that Rikka can get. Assuming the correct result is d\*d^\*, you need to ensure that dd\*maxd\*,1106\frac{|d - d^\*|}{\max\\{d^\*, 1\\}} \leq 10^{-6}.