#abc315g. G - Ai + Bj + Ck = X (1 <= i, j, k <= N)
G - Ai + Bj + Ck = X (1 <= i, j, k <= N)
Score : points
## 问题描述
给定整数 $N,A,B,C,X$。求满足以下所有条件的整数三元组 $(i,j,k)$ 的数量。
- $1 \le i,j,k \le N$
- $Ai + Bj + Ck = X$
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given integers . Find the number of triples of integers that satisfy all of the following conditions.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Sample Input 1
5 3 1 5 15
Sample Output 1
3
The following three triples satisfy the conditions.
- :
- :
- :
Sample Input 2
1 1 1 1 1
Sample Output 2
0
Sample Input 3
100000 31415 92653 58979 1000000000
Sample Output 3
2896
update @ 2024/3/10 09:01:18