Time limit
2s
Memory limit
128 MB
Dongju and Hangseung play at most N rounds of rock-paper-scissors. Each player's number of round wins is counted separately, and the first player to win K rounds wins the whole game.
Find the probability that Hangseung wins against Dongju. In every round, both players independently choose rock, paper, or scissors with equal probability.
The first line contains two integers N and K separated by a space. (1 <= K <= N <= 40)
If Hangseung's winning probability is A/B, print A and B separated by a space. A and B must be positive coprime integers.