Problem D
Equinumerous
Input
The first line of input is an integer $T$, the number of puzzles in the input file, satisfying $1\leq T\leq 100$. Each of the next $T$ lines contain two space-separated integers $n$, $k$, satisfying $1\leq n\leq 10^{18}$ and $2\leq k\leq 20$, where $n$ is the target sum, and $k$ is the number of equinumerous summands to be used in a solution to the puzzle.
Output
For each puzzle consisting of integers $n$, $k$, output one line with $k$ space-separated equinumerous integers that sum to $n$ if there is a solution to the puzzle. These integers should be in the usual base-$10$ representation. Otherwise, output the word “Impossible”. If there are multiple solutions to a puzzle, then output any one of them.
Sample Input 1 | Sample Output 1 |
---|---|
3 2 2 7 2 77 4 |
2 0 Impossible 10 56 9 2 |