|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|2 초 (추가 시간 없음)||1024 MB||3||3||3||100.000%|
There are $N$ robots numbered from $1$ through $N$ and $N$ antennas numbered from $1$ through $N$ in a straight line. The coordinate of the robot $i$ is $a_i$ and the coordinate of the antenna $i$ is $b_i$. All coordinates are distinct.
Currently, all antennas are inactive. You are going to activate them one by one. When you activate an antenna, the nearest robot (if two robots are closest to it, only the left one) moves to the antenna and explodes along with it.
Find an order to activate antennas so that the total distance of robots' moves is minimum possible.
Input is given from Standard Input in the following format:
$a_1$ $a_2$ $\dots$ $a_N$
$b_1$ $b_2$ $\dots$ $b_N$
Print the answer in the following format:
$p_1$ $p_2$ $\dots$ $p_N$
Here, $X$ must be a minimum total distance, and $p_i$ is the index of the antenna that you activate in the $i$-th.
If there are multiple solutions, you can print any of them.
3 1 2 3 11 12 13
30 3 2 1