- All Contests
- HourRank 21
- Who Gets the Catch?

# Who Gets the Catch?

# Who Gets the Catch?

A wild venotoise has spawned in the middle of the street, and *catchers* are nearby! Venotoises are quite rare and disappear quickly, so the catchers begin racing towards it. Your task is to find who will catch the venotoise.

We represent the street as a long, straight line. The catcher is located at position along this line, and the venotoise is located at position . The venotoise is stationary, and the catcher is moving towards the venotoise at a speed of units per second. A catcher moving at a speed of units per second can travel a distance of units in exactly seconds.

The first catcher that makes it to the location of the venotoise catches it. If there isn't a unique "first catcher", that is, if there are two or more catchers that initially reach the venotoise at the exact same time, then the venotoise disappears, and no one gets the catch.

**Input Format**

The first line contains two space-separated integers, , the number of catchers, and , the venotoise's location.
The second line contains space-separated integers, , denoting the locations of the catchers.

The third line contains space-separated integers, , denoting the speeds of the catchers.

**Constraints**

- Each catcher can reach the venotoise's location in an integer number of seconds.

**Output Format**

Print one line containing a single integer denoting the index of the catcher that catches the venotoise, or if no one gets the catch.

**Sample Input 0**

```
4 400
500 500 900 200
2 4 25 5
```

**Sample Output 0**

```
2
```

**Explanation 0**

In this example, there are catchers and the venotoise is at location .

- Catcher is at location and has a speed of . It will take her seconds to reach the venotoise.
- Catcher is at location and has a speed of . It will take him seconds to reach the venotoise.
- Catcher is at location and has a speed of . It will take him seconds to reach the venotoise.
- Catcher is at location and has a speed of . It will take her seconds to reach the venotoise.

Thus, catcher reaches the venotoise ahead of everyone else, so we print `2`

.

**Sample Input 1**

```
4 400
500 500 900 200
2 4 25 10
```

**Sample Output 1**

```
-1
```

**Explanation 1**

This is similar to the first example, except that catcher now has a speed of , so it will take her seconds to reach the venotoise.

Thus, catcher and catcher reach the venotoise at the same time and ahead of everyone else, so the venotoise disappears and no one gets the catch. Thus, we print `-1`

.

**Sample Input 2**

```
4 400
400 500 900 200
2 4 25 5
```

**Sample Output 2**

```
0
```

**Explanation 2**

This is similar to the first example, except that catcher is now located at , which means she's already in the same location as the venotoise! Specifically, it will take her seconds to reach the venotoise.

Thus, catcher reaches the venotoise ahead of everyone else, so we print `0`

.