#GD0000008. Tanya và đồ chơi (Tanya and Toys)
Tanya và đồ chơi (Tanya and Toys)
Tanya and Toys
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Toy types are numbered by positive integers, and type costs . Tanya already owns distinct types and has budget at most . Buy as many new distinct types as possible, never buying a type already owned. If several optimal sets exist, any valid optimal set may be printed.
Input
The first line contains . The second line contains distinct integers .
Output
The first line prints . The second line prints distinct selected type indices in any order. If , the second line may be empty.
Subtasks
General constraints:
-
.
-
.
-
.
-
The are pairwise distinct.
-
Subtask 1 (20 points): ,
-
Subtask 2 (30 points): ,
-
Subtask 3 (50 points): No additional constraints.
Examples
Input
3 7
1 3 4
Output
2
2 5
Explanation
Type costs , and the next cheapest missing type is , costing . The total is exactly , so the sample buys two new types.