Chasing the Cheetahs

Given start times and speeds from one spot, find the smallest gap between the first and last cheetah at any time after all have started.

Medium6Binary searchMathNo attempts yetTime limit3sMemory limit256 MB

Problem

A film crew is shooting a documentary about animal speed and wants several cheetahs sprinting at full pace in a single shot. One running cheetah has been filmed many times already, so this time the crew is after a pack.

Herding every cheetah into one box and opening it all at once is too dangerous to try. Each cheetah gets its own start box instead, and the slower ones are released first. After a while the faster cheetahs overtake the slower ones and the pack draws together as tightly as it ever will. The crew wants the length of the pack at that moment.

All start boxes stand at the same place. Cheetah kk is released at time tkt_k and runs at the constant speed vkv_k from that moment on. At time TT the length of the pack is the distance between the leading cheetah and the trailing one.

The length is measured only once every cheetah has started, that is at Tmax(t1,,tN)T \ge \max(t_1, \dots, t_N). The track is long enough that the shortest moment arrives before the leading cheetah reaches the finish line. Find the minimum length of the pack.

Input

The input holds several test cases. The first line of a test case contains the number of cheetahs NN (1N1000001 \le N \le 100000). Each of the next NN lines contains two integers tkt_k and vkv_k separated by a space (1tk,vk999991 \le t_k, v_k \le 99999), the start time and the speed of cheetah kk.

The last line of the input contains a single 00. That line is not a test case.

Output

For each test case print the minimum length of the pack on its own line. Round the value to three digits after the decimal point and print all three digits, trailing zeros included.