Robots

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

There are NN robots numbered from 11 through NN and NN antennas numbered from 11 through NN in a straight line. The coordinate of the robot ii is a_ia\_i and the coordinate of the antenna ii is b_ib\_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:

NN

a_1a\_1 a_2a\_2 \dots a_Na\_N

b_1b\_1 b_2b\_2 \dots b_Nb\_N

출력

Print the answer in the following format:

XX

p_1p\_1 p_2p\_2 \dots p_Np\_N

Here, XX must be a minimum total distance, and p_ip\_i is the index of the antenna that you activate in the ii-th.

If there are multiple solutions, you can print any of them.

제한

  • 1N2×1051 \leq N \leq 2 \times 10^5
  • 0a_1<a_2<<a_N1090 \leq a\_1 < a\_2 < \dots < a\_N \leq 10^9
  • 0b_1<b_2<<b_N1090 \leq b\_1 < b\_2 < \dots < b\_N \leq 10^9
  • a_1,a_2,,a_N,b_1,b_2,,b_Na\_1, a\_2, \dots, a\_N, b\_1, b\_2, \dots, b\_N are all distinct.
  • All values in input are integers.