Card Game Strategy

Alice picks t in [a, b] to maximize the gap while Bob replies with k cards whose sum is closest to t.

Medium6Dynamic programmingGame theoryNo attempts yetTime limit5sMemory limit1024 MB

Problem

Alice and Bob play a card game. There are nn cards, and card ii has the integer xix_i written on it. The game runs in this order.

  1. Alice picks an integer between aa and bb, inclusive. Call that integer tt. Alice tells Bob the value of tt.
  2. Bob picks kk of the nn cards. Call the sum of the integers on the kk cards Bob picks uu.

Alice wants tu|t - u| to be as large as possible, and Bob wants it to be as small as possible.

Before the game starts, both players know nn, kk, aa, bb and the integer on every card. Both play optimally. In particular, Alice picks tt knowing that Bob will then make tu|t - u| as small as possible for the announced tt. If several values of tt are equally good, Alice picks the smallest of them.

Find the value of tt Alice picks, and the kk cards Bob picks for that tt.

Input

The first line contains the integers nn, kk, aa, bb (1kn6001 \le k \le n \le 600, 0ab1800000 \le a \le b \le 180000).

The second line contains the integers x1,,xnx_1, \dots, x_n (0xi3000 \le x_i \le 300), where xix_i is written on card ii.

Output

On the first line, print the value of tt Alice picks.

On the second line, print the numbers of the kk cards Bob picks in increasing order. When several sets of kk cards make tu|t - u| as small as possible, print the set whose increasing sequence of card numbers is lexicographically smallest.