You are given a sequence of length . Process queries of the following form.
i j x y: Count the elements among whose remainder modulo is .
Input
The input is given in the following format:
case case case
Each test case is given in the following format:
Output
For each test case, print the answer to every query on its own line.
Constraints
- .
- .
- .
- ().
- ().
- ().
- ().
- The sum of over all test cases does not exceed .
- The sum of over all test cases does not exceed .
Subtasks
Samples
입력
1
5 4
1 2 3 4 5
1 5 2 0
2 4 3 1
3 3 5 3
1 5 5 0
출력
2
1
1
1