🏡 index : github.com/captn3m0/codechef.git

---
{"category_name":"easy","problem_code":"FIXFIX","problem_name":"Fixed number of Fixed Points","problemComponents":{"constraints":"- $1 \\leq T \\leq 10^5$\n- $1 \\leq n \\leq 10^5$\n- $0 \\leq k \\leq n$\n- Sum of $n$ over all test cases doesn\u0027t exceed $2 \\cdot 10^6$\n","constraintsState":true,"subtasks":"","subtasksState":true,"inputFormat":"- First line of the input contains $T$, the number of test cases. Then the test cases follow.\n- Each test case contains a single line of input, two integers $n, k$.\n","inputFormatState":true,"outputFormat":"For each test case, print a permutation in a single line, if a permutation with the given constraints exists. Print $-1$ otherwise.\n","outputFormatState":true,"sampleTestCases":{"0":{"id":1,"input":"3\n2 1\n3 1\n4 2\n","output":"-1\n1 3 2\n3 2 1 4\n","explanation":"**Test case $1$:** There are total $2$ permutations of $[1, 2]$  which are $[1, 2]$ and $[2, 1]$. There are $2$ indices in $[1, 2]$ and $0$ indices in $[2, 1]$ for which $A_i=i$ holds true. Thus, there doesn\u0027t exist any permutation of $[1, 2]$ with exactly $1$ index $i$ for which $A_i=i$ holds true.\n\n**Test case $2$:** Consider the permutation $A = [1, 3, 2]$. We have $A_1 = 1$, $A_2 = 3$ and $A_3 = 2$. So, this permutation has exactly $1$ index such that $A_i=i$.","isDeleted":false}}},"video_editorial_url":"https://youtu.be/P4j10vcImyc","languages_supported":{"0":"CPP14","1":"C","2":"JAVA","3":"PYTH 3.6","4":"CPP17","5":"PYTH","6":"PYP3","7":"CS2","8":"ADA","9":"PYPY","10":"TEXT","11":"PAS fpc","12":"NODEJS","13":"RUBY","14":"PHP","15":"GO","16":"HASK","17":"TCL","18":"PERL","19":"SCALA","20":"LUA","21":"kotlin","22":"BASH","23":"JS","24":"LISP sbcl","25":"rust","26":"PAS gpc","27":"BF","28":"CLOJ","29":"R","30":"D","31":"CAML","32":"FORT","33":"ASM","34":"swift","35":"FS","36":"WSPC","37":"LISP clisp","38":"SQL","39":"SCM guile","40":"PERL6","41":"ERL","42":"CLPS","43":"ICK","44":"NICE","45":"PRLG","46":"ICON","47":"COB","48":"SCM chicken","49":"PIKE","50":"SCM qobi","51":"ST","52":"SQLQ","53":"NEM"},"max_timelimit":1,"source_sizelimit":50000,"problem_author":"utkarsh_adm","problem_tester":"","date_added":"25-09-2021","tags":{"0":"permutation","1":"simple","2":"start14","3":"utkarsh_adm"},"problem_difficulty_level":"Unavailable","best_tag":"","editorial_url":"https://discuss.codechef.com/problems/FIXFIX","time":{"view_start_date":1632936600,"submit_start_date":1632936600,"visible_start_date":1632936600,"end_date":1735669800},"is_direct_submittable":false,"problemDiscussURL":"https://discuss.codechef.com/search?q=FIXFIX","is_proctored":false,"visitedContests":{},"layout":"problem"}
---
Given a positive integer $n$ and an integer $k$ such that $0 \leq k \leq n$, find any permutation $A$ of $1, 2 \dots n$ such that the number of indices for which $A_i=i$ is exactly $k$. If there exists no such permutation, print $-1$. If there exist multiple such permutations, print any one of them.


<aside style='background: #f8f8f8;padding: 10px 15px;'><div>All submissions for this problem are available.</div></aside>