Under construction

Still being built. Things may change

Radio-Controlled Car Race

Interview

Time limit2sMemory limit1024 MB

Summary
Given each car's head start and constant speed, find the earliest time at which two cars are at the same distance from the start.
Level

Easy2 of 10

Topics
Brute force, Math
Solved
No attempts yet

Problem

Like every boy, Fedya has toy cars. He is lucky, though: all nn of his cars are radio-controlled. He spends whole days organizing different car races with his friends.

Of all race formats, Fedya likes straight-line races best. In this format the track is a straight line with no end. The race lasts until Fedya gets bored. At the start, each car is some distance from the starting line. This head start is xix_i meters for car ii. On the signal, all cars start moving from the starting line, and each car moves at a constant speed of viv_i meters per second. All cars move in the same direction, away from the start.

Fedya recently received a video camera and wants to film the highlights of the race. Above all, he wants to capture the first overtake, that is, the first moment when two cars are at the same distance from the start.

This event could take a long time to happen, so Fedya wants to set the camera to start recording automatically during an overtake. However, he cannot work out by himself how much time passes from the start of the race until the first overtake. Write a program that finds this value.

Input

The first line contains one integer nn, the number of cars on the track (2≤n≤1002 \le n \le 100). Each of the next nn lines contains two integers xix_i and viv_i, the distance from the start in meters and the speed of car ii in meters per second (1≤xi,vi≤10001 \le x_i, v_i \le 1000).

Initially, no two cars are at the same point. It is guaranteed that at least one overtake happens during the race.

Output

Print the number of seconds from the start until the first overtake, with an accuracy of at least 5 digits after the decimal point.

Hint

In the figure below, point AA marks the place where the overtake happens.

Examples2

  1. Example 1

    Input
    2
    1 3
    4 2
    
    Expected output
    3.00000
    
  2. Example 2

    Input
    2
    12 20
    2 21
    
    Expected output
    10.00000