Given a permutation with size n{n}n and an integer k{k}k, you should find a permutation substitution P{P}P that {1,2,,n}{1, 2, cdots, n}{1,2,,n} will become A{A}A after performing substitution P{P}P for exactly k{k}k times. Print the permutation after performing P{P}P for once on {1,2,,n}{1, 2, cdots, n}{1,2,,n}. If there are multiple solutions, print any of them. If there is no solution, print "-1" in one line.
Given a permutation with size n{n}n and an integer k{k}k, you should find a permutation substitution P{P}P that {1,2,⋯ ,n}{1, 2, cdots, n}{1,2,⋯,n} will become A{A}A after performing substitution P{P}P for exactly k{k}k times. Print the permutation after performing P{P}P for once on {1,2,⋯ ,n}{1, 2, cdots, n}{1,2,⋯,n}. If there are multiple solutions, print any of them. If there is no solution, print "-1" in one line.
(图片来源网络,侵删)