Trip to Amsterdam

View as PDF

Submit solution


Points: 1
Time limit: 2.0s
Memory limit: 256M

Problem types

Gülşah has an exciting work trip coming up to Amsterdam with her co-worker Berkay, for attending a programming conference. However, Gülşah has made the mistake to book a flight from an airline where the offers include limited amounts of baggage.

Gülşah wants to take a lot of stuff with her, but she knows that she can’t take everything. To help her out, we need to find a scenario where she doesn’t worry about planning her outfits for too long.

Given the list of items she wants to take, with weights and values; and the total baggage weight she could take; find the scenario where she’s the happiest with the list of items she’d take with her.

Input

The first line contains two numbers, \(n\) and \(k\) — the number of items and the total baggage weight she could take.

The next \(n\) lines contain two numbers each, \(w_i\) and \(v_i\) — the weight and value of the \(i\)th item.

  • \(1 \le n, k \le 10^3\)
  • \(1 \le w_i, v_i \le 10^9\)

It's guaranteed that all the test cases are set up such that at least one item can be taken.

Output

Print the indices of the items she should pack in ascending order. There may be more than one valid answer, feel free to print any of them.

Example

Input 1:

3 50
10 60
20 100
30 120

Output 1:

2 3

Input 2:

5 10
1 5
2 3
4 5
2 3
5 2

Output 2:

1 2 3 4

Explanation

Input 1: Gülşah wants to take three items with her, but she has a weight limit of \(50\) units. There are several options, she can take each item seperately, or make a pair out of them. She can not take all three with her because the sum of their weights is \(60\) units. Out of all options, one of the pair is the best, choosing the 2nd and 3rd items results in \(50\) units of weight and \(220\) units of value. This is the highest value of items that she can carry.