No.3156 Count That Day's N
Problem Statement
You are given positive integers $K$, $N$.
When a positive integer $n$ satisfies the following condition, $n$ is called a good number.
- It can be expressed as $n = K z^2 = x^6 + y^4$ using positive integers $x, y, z$.
Constraints
- $1 \le K \le N \le 10^{15}$
- All input values are integers.
Input
The input is given from standard input in the following format.
$K\ N$
Output
Print the answer. Print a newline at the end.
Sample
Sample 1
Input
9 10000
Output
1
For this input case, the condition for $n$ to be a good number is
that "it can be expressed as $n = 9z^2 = x^6 + y^4$ using positive integers $x, y, z$".
Among the positive integers less than or equal to $N = 10000$, the only good number is
$2025\ (= 9\cdot 15^2 = 3^6 + 6^4)$, so print $1$.
Sample 2
Input
4097 4097
Output
1
Sample 3
Input
3 1000000000000000
Output
0
Input values may not fit in a 32-bit integer type.
Sample 4
Input
9 1000000000000000
Output
43
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
jastaway
butsurizuki