Kaloyan was preparing an exam for his students and found the following problem to be pretty interesting. He wrote two numbers and and wants to find a sequence of integers where the sum of every consecutive elements (in the sequence) is strictly positive while the sum of every consecutive elements is strictly negative.
Task
Kaloyan found out that this sequence cannot be infinitely long. He tried to find a sequence of maximum possible length with the described property. However, it turns out to be rather difficult problem for Kaloyan. Help him by writing a program that finds the maximum length of such a sequence. You should find the answers to such pairs and . Additionally, you have to find a maximal sequence only for the first query.
Input data
The first line of the standard input contains one integer — the number of queries.
Each of the following lines contains two integers — and .
Output data
On the first line of the standard output you should print numbers — , separated with spaces, where is the answer for the -th query. On the second line you should print integers separated with spaces — a sequence with the desired property for the first query.
Constraints and clarifications
- The numbers in the sequence must be between and
# | Score | Constraints |
---|---|---|
1 | 0 | Example |
2 | 3 | for all queries |
3 | 4 | divides or divides for all queries |
4 | 9 | , |
5 | 12 | = |
6 | 15 | |
7 | 22 | |
8 | 35 | No additional constraints |
Example
stdin
3
3 5
1 5
4 2
stdout
6 4 3
5 -7 5 3 -7 5