Hide

Problem C
BizzFuzz

Languages en sv

Algot was just at an interview at a software company and had to solve the classic FizzBuzz problem. It consists of printing the integers from 1 to 100, but replacing each integer divisible by 3 to "Fizz", each divisible by 5 to "Buzz" and each divisible by both to "FizzBuzz".

He however has a slight variation in mind, and would like you to calculate the number of integers between A and B (inclusive) divisible by both C and D.

Input

One row with the integers A,B,C,D such that 1AB1018 and 1C,DB .

Output

One row with the number of X such that AXB where C divides X and D divides X.

Scoring

Your solution will be tested on a number of testgroups. To earn points in a testgroup all tests in it must succeed.

Group

Points

Limits

1

20

|BA|<1000

2

20

A=1,C=1

3

20

D=2C

4

40

No further restrictions

Sample Input 1 Sample Output 1
1 20 2 5
2
Sample Input 2 Sample Output 2
1 15 1 3
5
Sample Input 3 Sample Output 3
3 15 3 6
2
Sample Input 4 Sample Output 4
11 121 1 11
11
Hide

Please log in to submit a solution to this problem

Log in