100 atcoder#ABC199B. [ABC199B] Intersection
[ABC199B] Intersection
Score : points
Problem Statement
You are given sequences of length each: and . Find the number of integers satisfying the following condition:
- holds for every integer such that .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
2
3 2
7 5
3
must satisfy both and . There are three such integers: , , and .
3
1 5 3
10 7 3
0
There may be no integer satisfying the condition.
3
3 2 5
6 9 8
2