Pascal Multiple
시간 제한1초메모리 제한1024 MB
파스칼 삼각형의 처음 N+1개 행에서 이항계수가 K로 나누어떨어지는 항목의 개수를 센다.
문제
The th binomial coefficient, denoted , is the (zero-indexed) th entry of the (zero-indexed) th row in Pascal's triangle:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
...
where and the st row can be computed from the th row using the recursion treating as any out-of-bounds entries of the triangle on the right-hand side.
Given and , compute how many entries in the first rows of Pascal's triangle are multiples of . To be precise: for how many pairs of indices with and , is divisible by ?
입력
The single line of input contains two positive integers and , with meaning as described above.
출력
Print the number of entries in the first rows of Pascal's triangle that are divisible by .