#P8177. 「EZEC-11」等差数列
「EZEC-11」等差数列
Description
You are given an arithmetic progression of length , with first term and common difference .
Choose any two numbers from (), and they must satisfy at the same time:
- is even.
- is not in .
Then you may add into . This is called one operation.
Note: Newly added numbers can also be chosen.
What is the maximum number of operations you can perform?
Input Format
This problem has multiple sets of testdata.
The first line contains a positive integer , the number of testdata sets.
For each testdata set, one line contains three integers .
Output Format
For each testdata set, output one integer per line, the maximum number of operations.
2
3 1 1
2 2 2
0
1
Hint
[Sample 1 Explanation]
For the first set of testdata, , so no operation can be performed.
For the second set of testdata, . You can choose and , and add into the sequence.
[Constraints and Notes]
This problem uses bundled tests.
- Subtask 1 (10 points): .
- Subtask 2 (10 points): .
- Subtask 3 (30 points): , , .
- Subtask 4 (50 points): no special restrictions.
For of the data, , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号