시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.6 초 1024 MB12000.000%

문제

John and Charlie are avid Starcraft fans and they love watching match replays. Tonight they are watching a replay of a match between two top players, HerO and Maru. The match is a best-of-N, meaning that the players play game after game until one wins the majority of N games (N is an odd number). If one player reaches a majority before N games, he wins the match immediately (remaining games are not played). For example, a best-of-7 match ends when a player reaches 4 wins, so it may last between 4 games (ending in a 4-0) and 7 games (ending in a 4-3). There are no draws in Starcraft and HerO and Maru have equal chances of winning any given game.

John accidentally peeked at the game list and saw that the match lasted K games. Charlie does not know K. This spoils John's fun, because he only enjoys watching interesting games, games whose winner he does not know in advance. Furthermore, as soon as John can predict the outcome of an upcoming game, he blurts out "I know who wins the next game" and tells Charlie the value of K.

Given N and K, what is the expected number of interesting games to be watched tonight, from Charlie's perspective?

입력

The input contains a single line with two numbers N and K.

출력

The output must contain the answer as an irreducible fraction. Write the numerator on the first line and the denominator on the second line.

제한

  • 1 ≤ N < 2,000
  • N is odd
  • (N + 1) / 2 ≤ K ≤ N

서브태스크

번호배점제한
120

N < 50

240

N < 300

320

N < 1,600

420

none

예제 입력 1

7 4

예제 출력 1

1
1

Here, only the first game is interesting. Since the match lasts for 4 games, it must end in a 4-0. Therefore, whoever wins the first games must have won every game, so games 2, 3 and 4 are not interesting.

예제 입력 2

5 4

예제 출력 2

5
2

We know that the match ends 3-1 (or 1-3). The first two games are interesting (winners cannot be predicted). After two games, the score can be:

  • 2-0 with a 25% chance. Then the last two games will not be interesting, as the match can only go 2-1, then 3-1 from here.
  • 0-2 with a 25% chance. Again, the last two games will not be interesting.
  • 1-1 with a 50% chance. In this case the third game will also be interesting. Whoever gets to 2-1 must go on to win 3-1, so the fourth game will not be interesting.

채점 및 기타 정보

  • 예제는 채점하지 않는다.