this easy version problem the difference easy hard version version output permutation smallest weightyou give permutation p_1 p_2 ldot p_n integer 1 nlet define weight permutation q_1 q_2 ldot q_n integer 1 n q_1 p_q_2 q_2 p_q_3 ldot q_n1 p_q_n q_n p_q_1You want permutation lightweight possible find permutation q small possible weight