Jealous Numbers
시간 제한: 3000ms메모리 제한: 256MB출처: NEERC Northern Subregional 2009BOJ 3559
문제
There is a trouble in Numberland, prime number is jealous of another prime number . She thinks that there are more integer numbers between and , inclusively, that are divisible by greater power of than that of . Help to get rid of her feelings.
Let be maximal such that is divisible by . Let us say that a number is -dominating over~ if . Find out for how many numbers between and , inclusive are -dominating over~.
입력
The first line of the input file contains , , and (; ; ; and are prime).
출력
Output one number --- how many numbers between and , inclusive, are -dominating over .
힌트
In the given example 3, 9, 15 and 18 are 3-dominating over 2.
예제
예제 1
입력
1 20 3 2
출력
4
코드를 제출하려면 로그인하세요.