Codeforces Round 218 (Div. 2)
E
Subway Innovation
Codeforces
2000
原题
← D→
翻译中…

Berland is going through tough times — the dirt price has dropped and that is a blow to the country's economy. Everybody knows that Berland is the top world dirt exporter!

翻译中…

The President of Berland was forced to leave only $*k*$ of the currently existing $*n*$ subway stations.

翻译中…

The subway stations are located on a straight line one after another, the trains consecutively visit the stations as they move. You can assume that the stations are on the $*Ox*$ axis, the $*i*$-th station is at point with coordinate $*x*_{*i*}$. In such case the distance between stations $*i*$ and $*j*$ is calculated by a simple formula $|*x*_{*i*} - *x*_{*j*}|$.

翻译中…

Currently, the Ministry of Transport is choosing which stations to close and which ones to leave. Obviously, the residents of the capital won't be too enthusiastic about the innovation, so it was decided to show the best side to the people. The Ministry of Transport wants to choose such $*k*$ stations that minimize the average commute time in the subway!

翻译中…

Assuming that the train speed is constant (it is a fixed value), the average commute time in the subway is calculated as the sum of pairwise distances between stations, divided by the number of pairs (that is image) and divided by the speed of the train.

翻译中…

Help the Minister of Transport to solve this difficult problem. Write a program that, given the location of the stations selects such $*k*$ stations that the average commute time in the subway is minimized.

翻译中…

Input

翻译中…

The first line of the input contains integer $*n*$ ($3 ≤ *n* ≤ 3·10^{5}$) — the number of the stations before the innovation. The second line contains the coordinates of the stations $*x*_{1}, *x*_{2}, ..., *x*_{*n*}$ ($- 10^{8} ≤ *x*_{*i*} ≤ 10^{8}$). The third line contains integer $*k*$ ($2 ≤ *k* ≤ *n* - 1$) — the number of stations after the innovation.

翻译中…

The station coordinates are distinct and not necessarily sorted.

翻译中…

Output

翻译中…

Print a sequence of $*k*$ distinct integers $*t*_{1}, *t*_{2}, ..., *t*_{*k*}$ ($1 ≤ *t*_{*j*} ≤ *n*$) — the numbers of the stations that should be left after the innovation in arbitrary order. Assume that the stations are numbered 1 through $*n*$ in the order they are given in the input. The number of stations you print must have the minimum possible average commute time among all possible ways to choose $*k*$ stations. If there are multiple such ways, you are allowed to print any of them.

翻译中…

Note

翻译中…

In the sample testcase the optimal answer is to destroy the first station (with $*x* = 1$). The average commute time will be equal to 1 in this way.

翻译中…

样例

Input #1
3
1 100 101
2
Output #1
2 3
InputCopy OutputCopy
题目信息
题号
371E
时间限制
2 s
内存限制
256 MB
标签
贪心
数学
双指针

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。