If a game can result in a win, worth one point; a draw, worth half a point; or a loss, worth no points; how many ways are there of scoring k
points in n
games?
Applicable scenarios include NFL and chess.
- Input is via stdin, and consists of
n
andk
on separate lines. n
will be a non-negative integer.(n ≤ 16)
k
will be either a non-negative integer or a non-negative integer plus a half.(k ≤ n)
- Output is to stdout. It may, but does not have to, include a trailing newline.
Test cases
In each case, the first two lines are user-supplied input and the third line is the program output.
10
4.5
8350
16
8
5196627
16
13.5
13328
12
12
1