Компьютерный форум OSzone.net  

Компьютерный форум OSzone.net (http://forum.oszone.net/index.php)
-   Программирование и базы данных (http://forum.oszone.net/forumdisplay.php?f=21)
-   -   Htr (http://forum.oszone.net/showthread.php?t=189139)

Hardcore 23-10-2010 12:54 1525416

Htr
 
Можеье объеснить в чем суть задачи? я нечего не понял.

Given two positive integers n and k. Your task is to output all Required to withdraw all of the chain x1, x2, ..., xN such that xi - natural and 1<=xi<=k.
Note. Use recursion for solving this problem.

Input:
Only one line that contains n and k (1 <= n,k <= 6).

Output:
Your output have to be

Examples:

Input 1:
2 3

Output 1:
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3


Input 2:
3 3

Output 2:
1 1 1
1 1 2
1 1 3
1 2 1
1 2 2
1 2 3
1 3 1
1 3 2
1 3 3
2 1 1
2 1 2
2 1 3
2 2 1
2 2 2
2 2 3
2 3 1
2 3 2
2 3 3
3 1 1
3 1 2
3 1 3
3 2 1
3 2 2
3 2 3
3 3 1
3 3 2
3 3 3

lxa85 23-10-2010 17:57 1525612

Hardcore, просят решить Комбинаторную задачу.


Время: 17:48.

Время: 17:48.
© OSzone.net 2001-