Codeforces Round 489 (Div. 2)
B
Nastya Studies Informatics
Codeforces
1600
原题
← AC →
翻译中…

Today on Informatics class Nastya learned about GCD and LCM (see links below). Nastya is very intelligent, so she solved all the tasks momentarily and now suggests you to solve one of them as well.

翻译中…

We define a pair of integers $(*a*, *b*)$ good, if $*GCD*(*a*, *b*) = *x*$ and $*LCM*(*a*, *b*) = *y*$, where $*GCD*(*a*, *b*)$ denotes the greatest common divisor of $*a*$ and $*b*$, and $*LCM*(*a*, *b*)$ denotes the least common multiple of $*a*$ and $*b*$.

翻译中…

You are given two integers $*x*$ and $*y*$. You are to find the number of good pairs of integers $(*a*, *b*)$ such that $*l* ≤ *a*, *b* ≤ *r*$. Note that pairs $(*a*, *b*)$ and $(*b*, *a*)$ are considered different if $*a* ≠ *b*$.

翻译中…

Input

翻译中…

The only line contains four integers $*l*, *r*, *x*, *y*$ ($1 ≤ *l* ≤ *r* ≤ 10^{9}$, $1 ≤ *x* ≤ *y* ≤ 10^{9}$).

翻译中…

Output

翻译中…

In the only line print the only integer — the answer for the problem.

翻译中…

Note

翻译中…

In the first example there are two suitable good pairs of integers $(*a*, *b*)$: $(1, 2)$ and $(2, 1)$.

翻译中…

In the second example there are four suitable good pairs of integers $(*a*, *b*)$: $(1, 12)$, $(12, 1)$, $(3, 4)$ and $(4, 3)$.

翻译中…

In the third example there are good pairs of integers, for example, $(3, 30)$, but none of them fits the condition $*l* ≤ *a*, *b* ≤ *r*$.

翻译中…

样例

Input #1
1 2 1 2
Output #1
2
InputCopy OutputCopy
Input #2
1 12 1 12
Output #2
4
InputCopy OutputCopy
Input #3
50 100 3 30
Output #3
0
InputCopy OutputCopy
题目信息
题号
992B
时间限制
1 s
内存限制
256 MB
标签
数学
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。