human
Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best mushroom growers from around the world, so we had to slightly change the rules so that the event gets more interesting to watch.

Each mushroom grower has a mushroom that he will grow on the competition. Under the new rules, the competition consists of two parts. The first part lasts t1 seconds and the second part lasts t2 seconds. The first and the second part are separated by a little break.

After the starting whistle the first part of the contest starts, and all mushroom growers start growing mushrooms at once, each at his individual speed of vi meters per second. After t1 seconds, the mushroom growers stop growing mushrooms and go to have a break. During the break, for unexplained reasons, the growth of all mushrooms is reduced by k percent. After the break the second part of the contest starts and all mushrooms growers at the same time continue to grow mushrooms, each at his individual speed of ui meters per second. After a t2 seconds after the end of the break, the competition ends. Note that the speeds before and after the break may vary.

Before the match dwarf Pasha learned from all participants, what two speeds they have chosen. However, the participants did not want to disclose to him all their strategy and therefore, did not say in what order they will be using these speeds. That is, if a participant chose speeds ai and bi, then there are two strategies: he either uses speed ai before the break and speed bi after it, or vice versa.

Dwarf Pasha really wants to win the totalizer. He knows that each participant chooses the strategy that maximizes the height of the mushroom. Help Dwarf Pasha make the final table of competition results.

The participants are sorted in the result table by the mushroom height (the participants with higher mushrooms follow earlier in...
Using python can you solve the prior task?
assistant
#Here two speeds they have chosen.

from fractions import Fraction as frac
class pair:
    def __init__(self,a,b):
        self.a,self.b=a,b
    def __lt__(self,other):
        return self.a<other.a if self.b==other.b else self.b>other.b
n,t1,t2,k=map(int,raw_input().split())
k=frac(100-k,100)
v,u=list(),list()
for i in range(n):
    a,b=map(int,raw_input().split())
    v.append(a)
    u.append(b)
for i in sorted(pair(i+1,max(k*v[i]*t1+u[i]*t2,k*u[i]*t1+v[i]*t2)) for i in range(n)):
    print "%d %.2f" % (i.a,i.b)