All submissions for this problem are available.Chef Ada is the FootBall coach of the Dinosaurs Institute of Technology. There are $N$ dinosaurs (enumerated $1$ through $N$) placed in a line. The i-th dinosaur has a height of $i$ meters. Ada is training The dinosaurs in the following tactic: - Initially the leftmost dinosaur has the ball. - The dinosaur that has the ball passes the ball to the nearest dinosaur to the right that is tallest than him. - The previous step continues until the ball reaches the tallest dinosaur, then he throws the ball and scores a goal! Help Ada reordering the dinosaurs in such a way that the ball is passed from dinosaur to dinosaur exactly $K$ times. For example, if there are $5$ dinosaurs ordered as $[2,3,1,5,4]$, then the ball goes $2 \rightarrow 3\rightarrow5 \rightarrow goal$, and the ball was passed two times. ###Input: - First line will contain $T$, number of testcases. - Each test case consist of a line with two space separated integers $N,K$. ###Output: For each testcase, output in a single line conaining $N$ integers representing one possible ordering in which the dinosaurs can be placed. ###Constraints - $1 \leq T \leq 2^8$ - $2 \leq N \leq 20$ - $0 \leq K \leq N-1$ ###Sample Input: ``` 1 5 2 ``` ###Sample Output: ``` 2 3 1 5 4 ```
|Tags||alei, cnmp2019, pattern, simple, taran_1407|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.