Under construction

Still being built. Things may change

Flower Festival

Interview

Time limit2sMemory limit1024 MB

Summary
Given each car's position and constant speed on a road of length f, find the number of the car that reaches the end first.
Level

Easy2 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

Today is the Flower Festival. The festival is held in Rose Square, at the end of Flower Street. People are driving toward the festival on Flower Street in nn cars, numbered 1 through nn. Soroush, a traffic analyst, has used the traffic cameras on Flower Street to record the current location and speed of every car. Each car keeps a constant speed for the whole trip. A car's location is its distance from the start of Flower Street. Help Soroush find the first car to arrive at the festival. No two cars reach Rose Square at the same time.

Input

The first line contains two space-separated integers nn (1≤n≤1001 \le n \le 100) and ff (1≤f≤100001 \le f \le 10000), the number of cars and the length of Flower Street. The (i+1)(i+1)-th line (1≤i≤n1 \le i \le n) contains two space-separated integers xix_i (0≤xi<f0 \le x_i < f) and viv_i (1≤vi≤1001 \le v_i \le 100), the observed location and speed of car ii.

Output

Print the number of the car that arrives at Rose Square first.

Examples2

  1. Example 1

    Input
    3 200
    0 1
    10 5
    40 1
    
    Expected output
    2
    
  2. Example 2

    Input
    5 100
    0 1
    10 3
    60 2
    75 1
    10 4
    
    Expected output
    3