Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Prepared by Ibrahim Mesecan.
k-ary Strings
Question:
A k-ary code is a string of code which uses only the
only the digits from 0 until k-1.
Make a program to Generate all k-ary strings of n-digit.
Input specification
You will be given two integers the length of
of k-ary strings (n) and the range of digits (k)
where 1 ≤ n ≤ 8 and 2 ≤ k ≤ 5
Output specification
Show all k-ary strings with the length n.
Every string starts from 0 and then goes until k-1.
Each string is shown in a separate line. No space
is used within the characters of a string.
Sample Input I
2 3
|
Sample Input II
2 4
|
Sample Output I
00
01
02
10
11
12
20
21
22
|
Sample Output II
00
01
02
03
10
11
12
13
20
21
22
23
30
31
32
33
|
Для отправки решений необходимо выполнить вход.
|