|
||||||||||
Increasing and DecreasingTime Limit: 3000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1221 Accepted Submission(s): 451 Problem Description Notice£ºDon't output extra spaces at the end of one line. Given $n, x, y$, please construct a permutation of length $n$, satisfying that: - The length of LIS(Longest Increasing Subsequence) is equal to $x$. - The length of LDS(Longest Decreasing Subsequence) is equal to $y$. If there are multiple possible permutations satisfying all the conditions, print the lexicographically minimum one. Input The first line contains an integer $T(1 \leq T \leq 100)$, indicating the number of test cases. Each test case contains one line, which contains three integers $n, x, y(1 \leq n \leq 10^5, 1 \leq x, y \leq n)$. Output For each test case, the first line contains ``YES'' or ``NO'', indicating if the answer exists. If the answer exists, output another line which contains $n$ integers, indicating the permutation. Sample Input
Sample Output
Source | ||||||||||
|