#P9788. [ROIR 2020] 区域规划 (Day2)
[ROIR 2020] 区域规划 (Day2)
Problem Description
Translated from ROIR 2020 Day2 T2. Планировка участка, translated by Alpha1022.
Translator’s note: Since the original statement was a bit hard for the translator to understand, the meaning is abstracted directly here.
You have four variables that must satisfy:
- .
- .
- .
- .
For given , find how many possible assignments of there are.
Input Format
The first line contains two integers .
If , it means the second condition is ignored.
Output Format
One line, the number of valid assignments of .
3 0
1
5 0
5
5 3
2
Hint
Sample 1 Explanation
Only is valid.
Sample 2 Explanation
The following assignments are valid:
- ;
- ;
- ;
- ;
- .
Sample 3 Explanation
The following assignments are valid:
- ;
- .
Constraints
For of the testdata, .
The detailed limits are shown in the table below:
| Subtask ID | Points | Constraints |
|---|---|---|
Translated by ChatGPT 5