P8284 "DAOI R1" Concert

Background

> $ \texttt{I want to be an artist.} $

Description

$ \texttt{Erinyes} $'s school is going to hold a concert, but if he wants to join it, he must pass an assessment first. The problem is as follows: Given two integers $ n,k $, meaning there are $ n $ students, you need to assign one number to each student, that is, for the integer $ n $, construct a sequence $ a $. The numbers given to the students must satisfy the following properties: - For each $ i\;(1 \leq i \leq n-1) $, it holds that $ a_i=\gcd(a_{i+1},a_{i+2},\dots,a_{n-1},a_n) $. - For each $ i\;(1 \leq i \leq n) $, it holds that $ 1 \leq a_i \leq 10^5 $. - For each $ i\;(1 \leq i \leq 10^5) $, $ a_i $ appears in the sequence at most $ k $ times. But this is too easy for $ \texttt{Erinyes} $, so he decides to focus on preparing for the performance, and leaves this problem to you. Your task is to output the number of such sequences $ l $ and all such sequences. Since the answer may be very large, the output rules are as follows: - If $ l=0 $, output ```Impossible```. - If $ 1 \leq l \leq 4 $, output the actual number of sequences, then output $ l $ lines, one sequence per line, representing the sequences you constructed. - If $ l \geq 5 $, output ```5 or more```, then output five lines, one sequence per line, representing the lexicographically smallest five among the sequences you constructed. - You must output in lexicographical order.

Input Format

The first line reads an integer $ t $, meaning there are $ t $ test cases. For each test case, read two integers $ n,k $.

Output Format

For each test case, output one integer or one string on the first line. If it is possible to construct, then output one sequence you constructed per line afterwards.

Explanation/Hint

### Sample Explanation For the first test case, you can see that this solution is optimal. For the second test case, no matter what you do, it is impossible to construct a correct sequence. For the third test case, no matter what you do, it is impossible to construct a correct sequence. For the fourth test case, no matter what you do, it is impossible to construct a correct sequence. ### Constraints For $ 100\% $ of the testdata, $ 1 \leq t \leq 100,1 \leq n \leq 10^5,0 \leq k \leq 10^5 $. Translated by ChatGPT 5