题号:NC222159
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
Chino held a blind date event, there are

male guests and

female guests attending.
The personality characteristic value of each person can be represented by an integer, the personality characteristic value of the

male guest is

, and the personality characteristic value of the

female guest is

.
Chino believes that when the calculation result of the personality characteristic values of two people

in a certain range

, the personality of two person is suitable each of them.
Chino would like to know how many matching combinations possible satisfied personality suitability between male and female guests.
输入描述:
The first line contain two positive integers )
The next line contain
integers
indicates the personality characteristic value of the male guests.
Then the next line contain
integers
indicates the personality characteristic value of the female guests.
the final line only contain two integers )
输出描述:
Output an integer on a line to indicate the number of matching combinations.
示例2
输入
复制
3 4
-1 -3 -5
-7 -6 -8 -9
9 9
说明
For the second example, there is only a legal matching combination for male guest
and female guest
.