

/*
Tree
(start)
/ | \
/ | \
1 2 3
/ | \ | \ \
/ | \ | \ \
2 3 4 3 4 4
*/
import Foundation
var n: Int = 0
var m: Int = 0
var res: [Int] = []
var cnt = 0
func dfs(_ L: Int, _ s: Int) {
if L == m {
for i in 0..<m {
print(res[i], terminator: " ")
}
print()
cnt += 1
} else {
for i in s..<n+1 {
res[L] = i
dfs(L + 1, i + 1)
}
}
}
n = 4
m = 2
res = [Int](repeating: 0, count: m)
dfs(0, 1)
print(cnt)