Ito

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

문제

Math can be very interesting and fascinating, no doubt it deserves a life to be devoted to it. However, if you plan to end up your days somewhere in Caribbeans, feeling warm sand with your feet and watching beautiful women bringing Pina Colada one by one, you really should find another application of your skills. 

That's why Kiyoshi decided his impact to math is already great, so he can go and make some money. As you probably heard, an economical crisis is quickly approaching and everyone cares about efficient way to save their money. While trying to follow new market trends, Kiyoshi opened a consulting agency that helps clients to invest their savings properly. Investment process in this problem consists of three easy steps: go to the market and buy some valuables, wait a year, then go to the market again to sell valuables.

There are NN different valuables available for the investment. For each of them the current price c_ic\_i wooddollars for one measure unit is given. You may assume that all the valuables are unlimited in quantity and arbitrary divisible, i.e. it's possible to buy any non-negative real amount of any valuable. Also, for each valuable two limitations a_ia\_i and b_ib\_i are known, determining that next year the cost of one measure unit will be continuously and uniformly distributed between these values.

MM clients want Kiyoshi to create a good investment plan for them. ii-th of them has s_is\_i wooddollars. From the one hand, each client wants to maximize the expected amount of money he will possess after selling all valuables. From the other hand they are afraid of loosing too much, so they want to have at least l_il\_i wooddollars in the worst case.

For each of the clients Kiyoshi needs to choose how much of each of the valuables client should buy. The client can spend any amount of wooddollars, but no more than he owns. Of course, he will possess all the unspent money next year.

The data is too large, so Kiyoshi asks you to help. Tell each client the maximum expected sum of woddollars he could have, without risking too much.

입력

The first line of the input contains two integers NN and MM (0N,M100,0000 \leq N, M \leq 100\\,000) --- the number of valuables available and the number of the clients.

The following NN lines describe the valuables available to buy on the market. Each of them contains three integers c_ic\_i, a_ia\_i and b_ib\_i, denoting the current cost of the valuable and the limitations on the future cost a_ia\_i and b_ib\_i (1c_i100,0001 \leq c\_i \leq 100\\,000, 0a_ib_i100,0000 \leq a\_i \leq b\_i \leq 100\\,000).

Then follow MM lines describing Kiyoshi's clients. For each client integers s_is\_i and l_il\_i are given --- the amount of money he has and the minimal amount of money he can agree to have in the worst case (1l_is_i100,0001 \leq l\_i \leq s\_i \leq 100\\,000).

출력

Print MM lines, ii-th of them containing a single real value --- the maximum expected amount of wooddollars ii-th client could have, without risking too much . Your answer will be considered correct, if it's absolute or relative error won't exceed 10610^{-6}.

Formally, if your answer is AA and the jury's answer is BB, the checker will accept your answer if ABmax(1,B)106\frac{|A-B|}{\max(1,B)} \leq 10^{-6}.

힌트

In the example above, the first client can buy 0.10.1 units of the second valuable and 99 units of the third valuable.

The second client can buy 0.40.4 units of the first valuable, 0.30.3 units of the second valuable and 33 units of the third valuable.

The third client can just buy 11 unit of the second valuable.