Increasing and Decreasing

TimeLimit:3000MS  MemoryLimit:524288KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
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.
SampleInput
4
10 1 10
10 10 1
10 5 5
10 8 8
SampleOutput
YES
10 9 8 7 6 5 4 3 2 1
YES
1 2 3 4 5 6 7 8 9 10
YES
1 2 3 5 4 10 9 8 7 6
NO
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数0
总提交量0
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: