405853: GYM102135 F The closest subsequence
Description
Given an array A consisting of n integers, and some number k. You are required to find such a subsequence of A that its median m will be as close as possible to the number k, i.e. |m - k| is minimal, and this subsequence has maximum length among all such subsequences.
The median of the array X of length len is the number in the array X (xi ≤ xi + 1) at position , when array is sorted in the nondecreasing order. Let us assume that the array X indices start from 1.
InputThe first line contains two integers n and k (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 109) — the array A size and the number, which is meant to be the closest to the median, respectively.
The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — array A elements.
OutputThe first line contains one integer l (1 ≤ len ≤ n) — the subsequence size.
The second line contains len integers p1, p2, ..., plen (1 ≤ pi ≤ n, pi < pi + 1) — the indices of the array A elements included in this subsequence.
ExamplesInput5 3Output
1 2 3 4 5
5Input
1 2 3 4 5
5 42Output
1 2 3 4 5
1
5