BNUMBERS - Beautiful Numbers

no tags 

An integer N is called beautiful if it consists of 1 and/or 2 and/or 3. Given k (1<=k<=5), your task is to generate recursively all possible beautiful integers of length k sorted in increasing order. Output a blank line after each test case.

Example

Input:
1
2 Output:
1
2
3

11
12
13
21
22
23
31
32
33

hide comments
_R0b_: 2015-04-26 00:14:45

3
1
1
2
3

2
1
2
3

11
12
13
21
22
23
31
32
33

3
1
2
3

11
12
13
21
22
23
31
32
33

111
112
113
121
122
123
131
132
133
211
212
213
221
222
223
231
232
233
311
312
313
321
322
323
331
332
333

Why WA ?

Magaker: 2014-10-27 12:59:03

please I dont understand what does he want in this problem

Last edit: 2014-10-27 12:59:26
Mohamed Gouda : 2014-08-18 18:01:58

damroo : the compiler will not check if your code have a recursive function or not , but you should code it using recursion to practice and be able to understand recursion

damroo: 2014-08-11 21:02:10

is it mandatory to do it with recursion ??


Added by:Mohamed Ali
Date:2013-04-27
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All