VK Cup 2012 Round 2
B
Lemmings
Codeforces
2000
原题
← AC →
翻译中…

As you know, lemmings like jumping. For the next spectacular group jump $*n*$ lemmings gathered near a high rock with $*k*$ comfortable ledges on it. The first ledge is situated at the height of $*h*$ meters, the second one is at the height of $2*h*$ meters, and so on (the $*i*$-th ledge is at the height of $*i*·*h*$ meters). The lemmings are going to jump at sunset, and there's not much time left.

翻译中…

Each lemming is characterized by its climbing speed of $*v*_{*i*}$ meters per minute and its weight $*m*_{*i*}$. This means that the $*i*$-th lemming can climb to the $*j*$-th ledge in image minutes.

翻译中…

To make the jump beautiful, heavier lemmings should jump from higher ledges: if a lemming of weight $*m*_{*i*}$ jumps from ledge $*i*$, and a lemming of weight $*m*_{*j*}$ jumps from ledge $*j*$ (for $*i* < *j*$), then the inequation $*m*_{*i*} ≤ *m*_{*j*}$ should be fulfilled.

翻译中…

Since there are $*n*$ lemmings and only $*k*$ ledges ($*k* ≤ *n*$), the $*k*$ lemmings that will take part in the jump need to be chosen. The chosen lemmings should be distributed on the ledges from $1$ to $*k*$, one lemming per ledge. The lemmings are to be arranged in the order of non-decreasing weight with the increasing height of the ledge. In addition, each lemming should have enough time to get to his ledge, that is, the time of his climb should not exceed $*t*$ minutes. The lemmings climb to their ledges all at the same time and they do not interfere with each other.

翻译中…

Find the way to arrange the lemmings' jump so that time $*t*$ is minimized.

翻译中…

Input

翻译中…

The first line contains space-separated integers $*n*$, $*k*$ and $*h*$ ($1 ≤ *k* ≤ *n* ≤ 10^{5}$, $1 ≤ *h* ≤ 10^{4}$) — the total number of lemmings, the number of ledges and the distance between adjacent ledges.

翻译中…

The second line contains $*n*$ space-separated integers $*m*_{1}, *m*_{2}, ..., *m*_{*n*}$ ($1 ≤ *m*_{*i*} ≤ 10^{9}$), where $*m*_{*i*}$ is the weight of $*i*$-th lemming.

翻译中…

The third line contains $*n*$ space-separated integers $*v*_{1}, *v*_{2}, ..., *v*_{*n*}$ ($1 ≤ *v*_{*i*} ≤ 10^{9}$), where $*v*_{*i*}$ is the speed of $*i*$-th lemming.

翻译中…

Output

翻译中…

Print $*k*$ different numbers from $1$ to $*n*$ — the numbers of the lemmings who go to ledges at heights $*h*, 2*h*, ..., *kh*$, correspondingly, if the jump is organized in an optimal way. If there are multiple ways to select the lemmings, pick any of them.

翻译中…

Note

翻译中…

Let's consider the first sample case. The fifth lemming (speed 10) gets to the ledge at height 2 in image minutes; the second lemming (speed 2) gets to the ledge at height 4 in 2 minutes; the fourth lemming (speed 2) gets to the ledge at height 6 in 3 minutes. All lemmings manage to occupy their positions in 3 minutes.

翻译中…

样例

Input #1
5 3 2
1 2 3 2 1
1 2 1 2 10
Output #1
5 2 4
InputCopy OutputCopy
Input #2
5 3 10
3 4 3 2 1
5 4 3 2 1
Output #2
4 3 1
InputCopy OutputCopy
题目信息
题号
163B
时间限制
1 s
内存限制
256 MB
标签
二分

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