#arc111e. [arc111_e]Simple Math 3
[arc111_e]Simple Math 3
Problem Statement
In this problem, you will be given test cases for each input.
Given integers , , , and , find the number of positive integers satisfying the following condition:
- None of the integers between and (inclusive) is a multiple of .
We can prove from the constraints that the count is finite.
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print lines.
The -th line should contain the answer for the -th case (, , , ).
Sample Input 1
2
3 1 2 5
99 101 103 105
Sample Output 1
1
25
The pairs for the first case are listed below. We can see that only satisfies the condition.