405853: GYM102135 F The closest subsequence

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. The closest subsequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

Input

The 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.

Output

The 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.

ExamplesInput
5 3
1 2 3 4 5
Output
5
1 2 3 4 5
Input
5 42
1 2 3 4 5
Output
1
5

加入题单

上一题 下一题 算法标签: