当前位置:首页|资讯

CF 1612B - Special Permutation

作者:您是打尖儿还是住店呢发布时间:2024-09-09

A permutation of length n is an array p=[p1,p2,…,pn] which contains every integer from 1 to n (inclusive) exactly once. For example, p=[4,2,6,5,3,1] is a permutation of length 6.


You are given three integers n, a and b, where n is an even number. Print any permutation of length n that the minimum among all its elements of the left half equals a and the maximum among all its elements of the right half equals b. Print -1 if no such permutation exists.


Input

The first line of the input contains one integer t (1≤t≤1000), the number of test cases in the test. The following t lines contain test case descriptions.


Each test case description contains three integers n, a, b (2≤n≤100; 1≤a,b≤n; a≠b), where n is an even number (i.e. nmod2=0).


Output

For each test case, print a single line containing any suitable permutation. Print -1 no such permutation exists. If there are multiple answers, print any of them.

------------

长度为 n 的排列是一个数组 p=[p1,p2,...,pn]。的数组,该数组包含从 1 到 n(包括 n)的每一个整数。例如,p=[4,2,6,5,3,1] 是长度为 6 的排列。


给你三个整数 n、a 和 b,其中 n 是偶数。打印任何长度为 n 的排列,如果其左半部所有元素中的最小值等于 a,右半部所有元素中的最大值等于 b。


输入

输入的第一行包含一个整数 t(1≤t≤1000),即测试中的测试用例数。随后的 t 行包含测试用例描述。


每个测试用例描述包含三个整数 n、a、b(2≤n≤100;1≤a,b≤n;a≠b),其中 n 为偶数(即 nmod2=0)。


输出

对于每个测试用例,打印包含任何合适排列的一行。打印 -1 不存在这样的排列。如果有多个答案,则打印其中任何一个。

---------

先把左边的根据条件填进去,剩下的就是右边的,然后再判断一次条件,如果不满足,输出-1,如果满足,那么就可以输出了,这道题是个大模拟,至少对我来说是这样子的,,,



Copyright © 2024 aigcdaily.cn  北京智识时代科技有限公司  版权所有  京ICP备2023006237号-1