CPython lite logoProblemsContests

2070. Filling an array

Initially, you have an array of one number - a1. The next operation is performed on this array k times. The elements of the array are taken and for each subsequent number the number of times it occurs and the number itself are written down. Then the same operation is performed on the resulting array. For example, look at k=4, a1=3. Initially, the array contains only one number 3. The new resulting array is:[1,3]. The process is repeated a second time. The resulting array will be:[1,1,1,3]. Next it will be [3,1,1,3]. Finally, the array becomes [1,3,2,1,1,3]. Your task is to know a1and k, print the final resulting array.


Input

In the first line 2 natural numbers, a1,k(1a1,k50).

Output

Print the resulting array.


Sample input 1

3 4

Sample output 1

1 3 2 1 1 3

Login to be able to submit.

Problem
A1 63
A2 61
B 56
C 31
D 39
E 26
F 6
G 10
H 2
I 2
J 5
AdvancedArrayLoops
57 / 5
Solved / unsolved count
2.0 s / 256 MB
Limits
LanguageSpecific limits
Python 3.124.0 s / - MB
Java 194.0 s / - MB