apaz/codeforces-genesys huggingface dataset:
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 256.0 MB

# Problem
378QAQ has a string $$$s$$$ of length $$$n$$$. Define the core of a string as the substring$$$^\dagger$$$ with maximum lexicographic$$$^\ddagger$$$ order.

For example, the core of "$$$\mathtt{bazoka}$$$" is "$$$\mathtt{zoka}$$$", and the core of "$$$\mathtt{aaa}$$$" is "$$$\mathtt{aaa}$$$".

378QAQ wants to rearrange the string $$$s$$$ so that the core is lexicographically minimum. Find the lexicographically minimum possible core over all rearrangements of $$$s$$$.

$$$^\dagger$$$ A substring of string $$$s$$$ is a continuous segment of letters from $$$s$$$. For example, "$$$\mathtt{defor}$$$", "$$$\mathtt{code}$$$" and "$$$\mathtt{o}$$$" are all substrings of "$$$\mathtt{codeforces}$$$" while "$$$\mathtt{codes}$$$" and "$$$\mathtt{aaa}$$$" are not.

$$$^\ddagger$$$ A string $$$p$$$ is lexicographically smaller than a string $$$q$$$ if and only if one of the following holds:

- $$$p$$$ is a prefix of $$$q$$$, but $$$p \ne q$$$; or
- in the first position where $$$p$$$ and $$$q$$$ differ, the string $$$p$$$ has a smaller element than the corresponding element in $$$q$$$ (when compared by their ASCII code).

For example, "$$$\mathtt{code}$$$" and "$$$\mathtt{coda}$$$" are both lexicographically smaller than "$$$\mathtt{codeforces}$$$" while "$$$\mathtt{codeforceston}$$$" and "$$$\mathtt{z}$$$" are not.

## Input Format
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1\leq t\leq 10^5$$$). The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$1\leq n\leq 10^6$$$) — the length of string $$$s$$$.

The next line of each test case contains the string $$$s$$$ of length $$$n$$$. The string $$$s$$$ consists of lowercase English letters.

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^6$$$.

## Output Format
For each test case, output the lexicographically minimum possible core over all rearrangements of $$$s$$$.

## Examples
```input
6
3
qaq
4
cccc
6
bazoka
6
zazzzz
7
ababbbb
7
ccbabcc
```
```output
qaq
cccc
z
zzz
bbababb
cbcacbc
```

## Note
In the first test case, all possible rearrangements and their corresponding cores are as follows:

- "$$$\mathtt{qaq}$$$", its core is "$$$\mathtt{qaq}$$$".
- "$$$\mathtt{aqq}$$$", its core is "$$$\mathtt{qq}$$$".
- "$$$\mathtt{qqa}$$$", its core is "$$$\mathtt{qqa}$$$".

So the core with the minimum lexicographic order in all rearrangement plans is "$$$\mathtt{qaq}$$$".

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 1.0 seconds
Memory limit: 256.0 MB

# Problem
You are given two distinct non-negative integers $$$x$$$ and $$$y$$$. Consider two infinite sequences $$$a_1, a_2, a_3, \ldots$$$ and $$$b_1, b_2, b_3, \ldots$$$, where

- $$$a_n = n \oplus x$$$;
- $$$b_n = n \oplus y$$$.

Here, $$$x \oplus y$$$ denotes the bitwise XOR operation of integers $$$x$$$ and $$$y$$$.

For example, with $$$x = 6$$$, the first $$$8$$$ elements of sequence $$$a$$$ will look as follows: $$$[7, 4, 5, 2, 3, 0, 1, 14, \ldots]$$$. Note that the indices of elements start with $$$1$$$.

Your task is to find the length of the longest common subsegment$$$^\dagger$$$ of sequences $$$a$$$ and $$$b$$$. In other words, find the maximum integer $$$m$$$ such that $$$a_i = b_j, a_{i + 1} = b_{j + 1}, \ldots, a_{i + m - 1} = b_{j + m - 1}$$$ for some $$$i, j \ge 1$$$.

$$$^\dagger$$$A subsegment of sequence $$$p$$$ is a sequence $$$p_l,p_{l+1},\ldots,p_r$$$, where $$$1 \le l \le r$$$.

## Input Format
Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of the test cases follows.

The only line of each test case contains two integers $$$x$$$ and $$$y$$$ ($$$0 \le x, y \le 10^9, x \neq y$$$) — the parameters of the sequences.

## Output Format
For each test case, output a single integer — the length of the longest common subsegment.

## Examples
```input
4
0 1
12 4
57 37
316560849 14570961
```
```output
1
8
4
33554432
```

## Note
In the first test case, the first $$$7$$$ elements of sequences $$$a$$$ and $$$b$$$ are as follows:

$$$a = [1, 2, 3, 4, 5, 6, 7,\ldots]$$$

$$$b = [0, 3, 2, 5, 4, 7, 6,\ldots]$$$

It can be shown that there isn't a positive integer $$$k$$$ such that the sequence $$$[k, k + 1]$$$ occurs in $$$b$$$ as a subsegment. So the answer is $$$1$$$.

In the third test case, the first $$$20$$$ elements of sequences $$$a$$$ and $$$b$$$ are as follows:

$$$a = [56, 59, 58, 61, 60, 63, 62, 49, 48, 51, 50, 53, 52, 55, 54, \textbf{41, 40, 43, 42}, 45, \ldots]$$$

$$$b = [36, 39, 38, 33, 32, 35, 34, 45, 44, 47, 46, \textbf{41, 40, 43, 42}, 53, 52, 55, 54, 49, \ldots]$$$

It can be shown that one of the longest common subsegments is the subsegment $$$[41, 40, 43, 42]$$$ with a length of $$$4$$$.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 256.0 MB

# Problem
You have been offered to play a game. In this game, there are $$$n$$$ possible outcomes, and for each of them, you must bet a certain integer amount of coins. In the event that the $$$i$$$-th outcome turns out to be winning, you will receive back the amount of coins equal to your bet on that outcome, multiplied by $$$k_i$$$. Note that exactly one of the $$$n$$$ outcomes will be winning.

Your task is to determine how to distribute the coins in such a way that you will come out ahead in the event of any winning outcome. More formally, the total amount of coins you bet on all outcomes must be strictly less than the number of coins received back for each possible winning outcome.

## Input Format
Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 50$$$) — the number of outcomes.

The second line of each test case contains $$$n$$$ integers $$$k_1,k_2,\ldots,k_n$$$ ($$$2 \le k_i \le 20$$$) — the multiplier for the amount of coins if the $$$i$$$-th outcome turns out to be winning.

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.

## Output Format
For each test case, output $$$-1$$$ if there is no way to distribute the coins as required. Otherwise, output $$$n$$$ integers $$$x_1, x_2,\ldots, x_n$$$ ($$$1 \le x_i \le 10^{9}$$$) — your bets on the outcomes.

It can be shown that if a solution exists, there is always a solution that satisfies these constraints.

If there are multiple suitable solutions, output any of them.

## Examples
```input
6
3
3 2 7
2
3 3
5
5 5 5 5 5
6
7 9 3 17 9 13
3
6 3 2
5
9 4 6 8 3
```
```output
27 41 12 
1 1 
-1
1989 1547 4641 819 1547 1071 
-1
8 18 12 9 24
```

## Note
In the first test case, the coins can be distributed as follows: $$$27$$$ coins on the first outcome, $$$41$$$ coins on the second outcome, $$$12$$$ coins on the third outcome. Then the total amount of coins bet on all outcomes is $$$27 + 41 + 12 = 80$$$ coins. If the first outcome turns out to be winning, you will receive back $$$3 \cdot 27 = 81$$$ coins, if the second outcome turns out to be winning, you will receive back $$$2 \cdot 41 = 82$$$ coins, if the third outcome turns out to be winning, you will receive back $$$7 \cdot 12 = 84$$$ coins. All these values are strictly greater than $$$80$$$.

In the second test case, one way is to bet one coin on each of the outcomes.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 3.0 seconds
Memory limit: 256.0 MB

# Problem
The Manhattan distance between two points $$$(x_1, y_1)$$$ and $$$(x_2, y_2)$$$ is defined as: $$$$$$|x_1 - x_2| + |y_1 - y_2|.$$$$$$

We call a Manhattan triangle three points on the plane, the Manhattan distances between each pair of which are equal.

You are given a set of pairwise distinct points and an even integer $$$d$$$. Your task is to find any Manhattan triangle, composed of three distinct points from the given set, where the Manhattan distance between any pair of vertices is equal to $$$d$$$.

## Input Format
Each test consists of multiple test cases. The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains two integers $$$n$$$ and $$$d$$$ ($$$3 \le n \le 2 \cdot 10^5$$$, $$$2 \le d \le 4 \cdot 10^5$$$, $$$d$$$ is even) — the number of points and the required Manhattan distance between the vertices of the triangle.

The $$$(i + 1)$$$-th line of each test case contains two integers $$$x_i$$$ and $$$y_i$$$ ($$$-10^5 \le x_i, y_i \le 10^5$$$) — the coordinates of the $$$i$$$-th point. It is guaranteed that all points are pairwise distinct.

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.

## Output Format
For each test case, output three distinct integers $$$i$$$, $$$j$$$, and $$$k$$$ ($$$1 \le i,j,k \le n$$$) — the indices of the points forming the Manhattan triangle. If there is no solution, output "$$$0\ 0\ 0$$$" (without quotes).

If there are multiple solutions, output any of them.

## Examples
```input
6
6 4
3 1
0 0
0 -2
5 -3
3 -5
2 -2
5 4
0 0
0 -2
5 -3
3 -5
2 -2
6 6
3 1
0 0
0 -2
5 -3
3 -5
2 -2
4 4
3 0
0 3
-3 0
0 -3
10 8
2 1
-5 -1
-4 -1
-5 -3
0 1
-2 5
-4 4
-4 2
0 0
-4 1
4 400000
100000 100000
-100000 100000
100000 -100000
-100000 -100000
```
```output
2 6 1
4 3 5
3 5 1
0 0 0
6 1 3
0 0 0
```

## Note
In the first test case:

Points $$$A$$$, $$$B$$$, and $$$F$$$ form a Manhattan triangle, the Manhattan distance between each pair of vertices is $$$4$$$. Points $$$D$$$, $$$E$$$, and $$$F$$$ can also be the answer.

In the third test case:

Points $$$A$$$, $$$C$$$, and $$$E$$$ form a Manhattan triangle, the Manhattan distance between each pair of vertices is $$$6$$$.

In the fourth test case, there are no two points with a Manhattan distance of $$$4$$$, and therefore there is no suitable Manhattan triangle.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 1.5 seconds
Memory limit: 512.0 MB

# Problem
You are given a sequence $$$[a_1,\ldots,a_n]$$$ where each element $$$a_i$$$ is either $$$0$$$ or $$$1$$$. You can apply several (possibly zero) operations to the sequence. In each operation, you select two integers $$$1\le l\le r\le |a|$$$ (where $$$|a|$$$ is the current length of $$$a$$$) and replace $$$[a_l,\ldots,a_r]$$$ with a single element $$$x$$$, where $$$x$$$ is the majority of $$$[a_l,\ldots,a_r]$$$.

Here, the majority of a sequence consisting of $$$0$$$ and $$$1$$$ is defined as follows: suppose there are $$$c_0$$$ zeros and $$$c_1$$$ ones in the sequence, respectively.

- If $$$c_0\ge c_1$$$, the majority is $$$0$$$.
- If $$$c_0<c_1$$$, the majority is $$$1$$$.

For example, suppose $$$a=[1,0,0,0,1,1]$$$. If we select $$$l=1,r=2$$$, the resulting sequence will be $$$[0,0,0,1,1]$$$. If we select $$$l=4,r=6$$$, the resulting sequence will be $$$[1,0,0,1]$$$.

Determine if you can make $$$a=[1]$$$ with a finite number of operations.

## Input Format
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 4\cdot 10^4$$$). Description of the test cases follows.

The first line of each testcase contains one integer $$$n$$$ ($$$1\le n\le 2\cdot 10^5$$$).

The second line of each testcase contains a string consisting of $$$0$$$ and $$$1$$$, describing the sequence $$$a$$$.

It's guaranteed that the sum of $$$n$$$ over all testcases does not exceed $$$2\cdot 10^5$$$.

## Output Format
For each testcase, if it's possible to make $$$a=[1]$$$, print YES. Otherwise, print NO. You can output the answer in any case (upper or lower). For example, the strings yEs, yes, Yes, and YES will be recognized as positive responses.

## Examples
```input
5
1
0
1
1
2
01
9
100000001
9
000011000
```
```output
No
Yes
No
Yes
No
```

## Note
In the fourth testcase of the example, initially $$$a=[1,0,0,0,0,0,0,0,1]$$$. A valid sequence of operations is:

1. Select $$$l=2,r=8$$$ and apply the operation. $$$a$$$ becomes $$$[1,0,1]$$$.
2. Select $$$l=1,r=3$$$ and apply the operation. $$$a$$$ becomes $$$[1]$$$.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 512.0 MB

# Problem
You are given a positive integer $$$n$$$. Find the longest sequence of positive integers $$$a=[a_1,a_2,\ldots,a_k]$$$ that satisfies the following conditions, and print the sequence:

- $$$a_i\le n$$$ for all $$$1\le i\le k$$$.
- $$$a$$$ is strictly increasing. That is, $$$a_i>a_{i-1}$$$ for all $$$2\le i\le k$$$.
- $$$a_i\,|\,a_{i-1}=n$$$ for all $$$2\le i\le k$$$, where $$$|$$$ denotes the bitwise OR operation.

## Input Format
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 1000$$$). Description of the test cases follows.

The only line of each test case contains one integer $$$n$$$ ($$$1\le n\le 10^{18}$$$).

It's guaranteed that the sum of lengths of the longest valid sequences does not exceed $$$5\cdot 10^5$$$.

## Output Format
For each testcase, print two lines. In the first line, print the length of your constructed sequence, $$$k$$$. In the second line, print $$$k$$$ positive integers, denoting the sequence. If there are multiple longest sequences, you can print any of them.

## Examples
```input
4
1
3
14
23
```
```output
1
1
3
1 2 3
4
4 10 12 14
5
7 18 21 22 23
```

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 5.0 seconds
Memory limit: 512.0 MB

# Problem
For an array $$$u_1, u_2, \ldots, u_n$$$, define

- a prefix maximum as an index $$$i$$$ such that $$$u_i>u_j$$$ for all $$$j<i$$$;
- a suffix maximum as an index $$$i$$$ such that $$$u_i>u_j$$$ for all $$$j>i$$$;
- an ascent as an index $$$i$$$ ($$$i>1$$$) such that $$$u_i>u_{i-1}$$$.

You are given three cost arrays: $$$[a_1, a_2, \ldots, a_n]$$$, $$$[b_1, b_2, \ldots, b_n]$$$, and $$$[c_0, c_1, \ldots, c_{n-1}]$$$.

Define the cost of an array that has $$$x$$$ prefix maximums, $$$y$$$ suffix maximums, and $$$z$$$ ascents as $$$a_x\cdot b_y\cdot c_z$$$.

Let the sum of costs of all permutations of $$$1,2,\ldots,n$$$ be $$$f(n)$$$. Find $$$f(1)$$$, $$$f(2)$$$, ..., $$$f(n)$$$ modulo $$$998\,244\,353$$$.

## Input Format
The first line contains an integer $$$n$$$ ($$$1\le n\le 700$$$).

The second line contains $$$n$$$ integers $$$a_1,\ldots,a_n$$$ ($$$0\le a_i<998\,244\,353$$$).

The third line contains $$$n$$$ integers $$$b_1,\ldots,b_n$$$ ($$$0\le b_i<998\,244\,353$$$).

The fourth line contains $$$n$$$ integers $$$c_0,\ldots,c_{n-1}$$$ ($$$0\le c_i<998\,244\,353$$$).

## Output Format
Print $$$n$$$ integers: the $$$i$$$-th one is $$$f(i)$$$ modulo $$$998\,244\,353$$$.

## Examples
```input
3
1 1 1
1 1 1
1 1 1
```
```output
1 2 6
```
-----
```input
3
1 2 3
2 3 1
3 1 2
```
```output
6 13 34
```
-----
```input
5
1 4 2 5 3
2 5 1 3 4
300000000 100000000 500000000 400000000 200000000
```
```output
600000000 303511294 612289529 324650937 947905622
```

## Note
In the second example:

- Consider permutation $$$[1,2,3]$$$. Indices $$$1,2,3$$$ are prefix maximums. Index $$$3$$$ is the only suffix maximum. Indices $$$2,3$$$ are ascents. In conclusion, it has $$$3$$$ prefix maximums, $$$1$$$ suffix maximums, and $$$2$$$ ascents. Therefore, its cost is $$$a_3b_1c_2=12$$$.
- Permutation $$$[1,3,2]$$$ has $$$2$$$ prefix maximums, $$$2$$$ suffix maximums, and $$$1$$$ ascent. Its cost is $$$6$$$.
- Permutation $$$[2,1,3]$$$ has $$$2$$$ prefix maximums, $$$1$$$ suffix maximum, and $$$1$$$ ascent. Its cost is $$$4$$$.
- Permutation $$$[2,3,1]$$$ has $$$2$$$ prefix maximums, $$$2$$$ suffix maximums, and $$$1$$$ ascent. Its cost is $$$6$$$.
- Permutation $$$[3,1,2]$$$ has $$$1$$$ prefix maximum, $$$2$$$ suffix maximums, and $$$1$$$ ascent. Its cost is $$$3$$$.
- Permutation $$$[3,2,1]$$$ has $$$1$$$ prefix maximum, $$$3$$$ suffix maximums, and $$$0$$$ ascents. Its cost is $$$3$$$.

The sum of all permutations' costs is $$$34$$$, so $$$f(3)=34$$$.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 1.0 seconds
Memory limit: 256.0 MB

# Problem
Alice and Bob are playing a game in an array $$$a$$$ of size $$$n$$$.

They take turns to do operations, with Alice starting first. The player who can not operate will lose. At first, a variable $$$mx$$$ is set to $$$0$$$.

In one operation, a player can do:

- Choose an index $$$i$$$ ($$$1 \le i \le n$$$) such that $$$a_{i} \geq mx$$$ and set $$$mx$$$ to $$$a_{i}$$$. Then, set $$$a_{i}$$$ to $$$0$$$.

Determine whether Alice has a winning strategy.

## Input Format
The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases.

For each test case:

- The first line contains an integer $$$n$$$ ($$$2 \leq n \leq 50$$$) — the size of the array.
- The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \leq a_i \leq n$$$) — the elements of the array.

## Output Format
For each test case, if Alice has a winning strategy, output "YES". Otherwise, output "NO".

You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

## Examples
```input
5
2
2 1
2
1 1
3
3 3 3
4
3 3 4 4
4
1 2 2 2
```
```output
YES
NO
YES
NO
YES
```

## Note
In the first test case, Alice can choose $$$i=1$$$ since $$$a_1=2 \ge mx=0$$$.

After Alice's operation, $$$a=[0,1]$$$ and $$$mx=2$$$. Bob can not do any operation. Alice wins.

In the second test case, Alice doesn't have a winning strategy.

For example, if Alice chooses $$$i=1$$$, after Alice's operation: $$$a=[0,1]$$$ and $$$mx=1$$$. Then, Bob can choose $$$i=2$$$ since $$$a_2=1 \ge mx=1$$$. After Bob's operation: $$$a=[0,0]$$$ and $$$mx=1$$$. Alice can not do any operation. Bob wins.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 1.0 seconds
Memory limit: 256.0 MB

# Problem
For an array $$$b$$$ of size $$$m$$$, we define:

- the maximum prefix position of $$$b$$$ is the smallest index $$$i$$$ that satisfies $$$b_1+\ldots+b_i=\max_{j=1}^{m}(b_1+\ldots+b_j)$$$;
- the maximum suffix position of $$$b$$$ is the largest index $$$i$$$ that satisfies $$$b_i+\ldots+b_m=\max_{j=1}^{m}(b_j+\ldots+b_m)$$$.

You are given three integers $$$n$$$, $$$x$$$, and $$$y$$$ ($$$x > y$$$). Construct an array $$$a$$$ of size $$$n$$$ satisfying:

- $$$a_i$$$ is either $$$1$$$ or $$$-1$$$ for all $$$1 \le i \le n$$$;
- the maximum prefix position of $$$a$$$ is $$$x$$$;
- the maximum suffix position of $$$a$$$ is $$$y$$$.

If there are multiple arrays that meet the conditions, print any. It can be proven that such an array always exists under the given conditions.

## Input Format
The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases.

For each test case:

- The only line contains three integers $$$n$$$, $$$x$$$, and $$$y$$$ ($$$2 \leq n \leq 10^5, 1 \le y \lt x \le n)$$$.

It is guaranteed that the sum of $$$n$$$ over all test cases will not exceed $$$10^5$$$.

## Output Format
For each test case, output $$$n$$$ space-separated integers $$$a_1, a_2, \ldots, a_n$$$ in a new line.

## Examples
```input
3
2 2 1
4 4 3
6 5 1
```
```output
1 1
1 -1 1 1
1 1 -1 1 1 -1
```

## Note
In the second test case,

- $$$i=x=4$$$ is the smallest index that satisfies $$$a_1+\ldots +a_i=\max_{j=1}^{n}(a_1+\ldots+a_j)=2$$$;
- $$$i=y=3$$$ is the greatest index that satisfies $$$a_i+\ldots +a_n=\max_{j=1}^{n}(a_j+\ldots+a_n)=2$$$.

Thus, the array $$$a=[1,-1,1,1]$$$ is considered correct.

Now solve the problem and return the code.