Display of Springs

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

문제

Elater is a great magician. His most famous show is "Elater's Super Spectacular Display of Springs". The show consists in the following:

There are nn elastic springs in a line attached to the ceiling. Spring ii is attached at height h_ih\_i and has a stiffness constant k_ik\_i. If we attach a weight of mass ww to the lower end of the ii-th spring, the weight will descend to a height HH given by the formula:

H=h_iwk_i.H = h\_i - \frac{w}{k\_i}\text{.}

Elater will take questions from people in the audience. When asked about a positive integer ww, Elater will be able to pick the spring which, if a weight of mass ww is attached to its lower end, will descend to a height lower (closer to the floor) than all the other springs (in case of a tie, he will be able to pick one of the springs with the lowest descend height). To accomplish such an amazing feat, Elater has the help of his dear assistant, Hooke.

Before the show, Hooke has some time to do measurements on the springs. He can not directly measure the values of h_ih\_i and k_ik\_i, but he can choose two springs aa and bb and a mass ww, try attaching a weight of mass ww to the two springs, and see which of them goes closer to the floor with that weight. Before the show, he has time to do up to 20,00020\\,000 such measurements. Also, after each question, Elater can distract the audience for a while, so that Hooke can do up to 2020 more measurements before inconspicuously whispering the answer to Elater.

Can you help Hooke make the show successful? Assume that the springs are attached high enough, and the masses are small enough, so that the weights never reach the floor during any possible measurement. Also note that the weights are removed after each measurement.