#C2245. Winning Team Determination

    ID: 45540 Type: Default 1000ms 256MiB

Winning Team Determination

Winning Team Determination

In this problem, you are given t teams. For each team, you are provided with two integers: the total distance d covered and the total time t taken. Your task is to determine the winning team based on the highest average speed. The average speed is defined as

$v = \frac{d}{t}$

If two or more teams have the same average speed, the team with the lower total time is considered the winner. Teams are numbered from 1 to t in the order they appear in the input.

Example: For 3 teams with data:

  • Team 1: 500 distance, 5 time
  • Team 2: 400 distance, 4 time
  • Team 3: 600 distance, 6 time

All teams have an average speed of 100, but Team 2 wins because its time is the lowest among those tied (4 < 5 < 6). Hence, the output is 2.

inputFormat

The input is provided via standard input (stdin) and has the following format:

  1. The first line contains a single integer t, the number of teams.
  2. Each of the next t lines contains two space-separated integers representing the total distance and total time for a team.

outputFormat

Output a single integer to standard output (stdout) indicating the 1-based index of the winning team.

## sample
1
500 5
1

</p>