시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB39830197.917%

문제

For a fixed n and integers p and q such that |p| ≤ m and |q| ≤ m, how many equations of the form

xn + px + q = 0

have exactly one real root?

입력

The only line of input contains two integers n and m (1 ≤ n, m ≤ 106, n ≥ 2).

출력

Print a single integer: the number of equations having exactly one real root.

예제 입력 1

2 4

예제 출력 1

5

예제 입력 2

3 5

예제 출력 2

96