repeated permutation by Trimsty

x=input().split()
for i in __import__("itertools").product(*[range(1,int(x[0])+1)]*int(x[1])):print(*i)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page