#abc202c. C - Made Up
C - Made Up
Score : points
问题描述
已知三个长度均为 的序列:, 以及 ,其中包含的整数都在 到 (包括两端点)之间。
有多少对整数 满足 并且满足 ?
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Given are three sequences of length each: , , and , consisting of integers between and (inclusive).
How many pairs of integers between and (inclusive) satisfy ?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of pairs such that .
Sample Input 1
3
1 2 2
3 1 2
2 3 2
Sample Output 1
4
Four pairs satisfy the condition: .
Sample Input 2
4
1 1 1 1
1 1 1 1
1 2 3 4
Sample Output 2
16
All the pairs satisfy the condition.
Sample Input 3
3
2 3 3
1 3 3
1 1 1
Sample Output 3
0
No pair satisfies the condition.
update @ 2024/3/10 09:14:27