Олимпиадный тренинг

Задача 33139. Wicket in the fence


Uncle Fyodor, the cat Matroskin and Sharik decided to update the fence around their garden in Prostokvashino. Matroskin and Sharik, without thinking twice, dug N pillars along one of the sides of the site. This upset Uncle Fyodor very much, as his friends forgot about the most important — the gate had to be exactly on this side, and for it it was necessary to leave an opening with a width of at least W. Now they will have to dig out some posts.
 
To keep your work from going to waste, dig as few posts as possible. Help Uncle Fyodor determine which pillars to dig. After digging out the posts, there must be a gap (between the two remaining posts, or between the remaining post and the end of the side of the lot, or between the two ends of the side of the lot) of a width greater than or equal to W.
 
Input
The first line contains two integers N and W — the number of dug-in poles and the minimum required width of the opening for the gate, respectively. It is guaranteed that 0<=N<=30000 and that 0<=W<=60000.
 
We will assume that the coordinate axis is introduced along the side of the site that interests us. The second line of the input file contains two numbers L and R — coordinates of the left and right end of this side (LR). This is followed by N numbers — the coordinates of the dug-in pillars. All coordinates (including L and R) — different integers, modulo not exceeding 30000. It is guaranteed that all posts are dug between the left and right ends of the side.
 
Output
The first line of the output file should contain the minimum number of posts to be dug. The numbers of these pillars should follow. The columns are numbered in the order they are specified in the input file, starting from 1.
 
If there are multiple solutions, you can output any one. If there is no solution, then output one line containing the number -1 to the output file.
 
Input Output
3 2
2 6
3 4 5
1
2
3 2
16
4 3 5
0
3 5
1 7
5 3 4
3
2
1
3