luogu#P5246. [集训队互测 2016] 消失的源代码
[集训队互测 2016] 消失的源代码
Background
Opening an old set of problems, you find the statement has become blurry and unclear.
The contestants’ source code has also disappeared.
Only the compiled executable program remains.
You found the input files and hope to regenerate the output files.
Problem Description
Given the executable program and the input files , for each input file, compute its corresponding output file.
uses standard input and output. You can redirect input and output in the command line.
An executable program is also provided. It reads from and writes to . Other than that, is exactly the same as . You may choose or according to your habit.
is not perfect. When the data size is large, it may fail to run successfully, and in this case it will directly output invalid input!.
Input Format
The first line contains an integer representing the data type. will perform the corresponding computation based on the data type. For example, when the data type is , will compute the ( , ).
The second line contains an integer representing the number of test cases.
Then follows each test case. The input format is determined by the data type.
When the data size does not exceed the first test case, it is guaranteed that can run normally.
Only when the number of test cases does not exceed one, it is guaranteed that the output of is correct.
Output Format
For each test case, output one line.
0
2
2 3
4 7
5
11
Hint
Translated by ChatGPT 5