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 lost\texttt{lost} and the input files input*.txt\texttt{input*.txt}, for each input file, compute its corresponding output file.
lost\texttt{lost} uses standard input and output. You can redirect input and output in the command line.
An executable program lost2\texttt{lost2} is also provided. It reads from input.txt\texttt{input.txt} and writes to output.txt\texttt{output.txt}. Other than that, lost2\texttt{lost2} is exactly the same as lost\texttt{lost}. You may choose lost\texttt{lost} or lost2\texttt{lost2} according to your habit.
lost\text{lost} 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. lost\texttt{lost} will perform the corresponding computation based on the data type. For example, when the data type is 00, lost\texttt{lost} will compute the A+B Problem\texttt{A+B Problem} ( input0.txt\texttt{input0.txt}, output0.txt\texttt{output0.txt} ).
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 lost\texttt{lost} can run normally.
Only when the number of test cases does not exceed one, it is guaranteed that the output of lost\texttt{lost} is correct.

Output Format

For each test case, output one line.

0
2
2 3
4 7
5
11

Hint

Download input data

Translated by ChatGPT 5