P4920 [WC2015] Future Program

Description

In 2047, on the eve of the 64th National Olympiad in Informatics Winter Camp for Youth, person B found the problems from 2015, the 32nd Winter Camp, to practice. He opened the third problem, “Future Program”: ``` This is an output-only problem with a total of 10 test points. For each test point, you will be given the source code of a program and the input for that program. You need to run the program and save its output. Unfortunately, these programs are extremely inefficient and cannot produce output within the 5 hours of the contest. ``` Person B thought for a moment and decided to try running this problem using a computer from 2047. He found the 2015 compiler and soon got the results... At this moment, person B woke up from the dream and found that he was actually at the contest site of the 32nd Winter Camp. Everything before was just a dream, and he now needed to solve the problem “Future Program”. However, person B could no longer remember the results of running the programs in the dream. He tried to run these programs again, but found that the computer’s performance was far worse than in the dream, and indeed the programs could not produce results within 5 hours. He needs your help to obtain the results from the dream. This is an output-only problem with a total of 10 test points. For each test point, you will be given the source code of a program and the input for that program. You need to run the program and save the program’s output. Unfortunately, these programs are extremely inefficient and cannot produce output within the 5 hours of the contest. You need to help person B obtain the output of these programs.

Input Format

This problem has a total of 10 test points, numbered from 1 to 10. Below, “``*``” represents the test point number. For each test point, there are 4 files: program``*``.cpp, program``*``.c, program``*``.pas, and program``*``.in. You need to use your own method to obtain the output of compiling and running program``*``.{cpp, c, pas} with program``*``.in as the input. You only need to choose 1 of the 3 language versions to solve this problem. The code in these 3 languages is similar in meaning, and the running results are the same.

Output Format

For the given 10 test points, you need to save the program output into program``*``.out respectively. In particular, we guarantee that each test point will output exactly 10 lines.

Explanation/Hint

Please download the input data. The sample input is in example.{in,cpp,c,pas}, and the sample output is in example.ans. **To make the SPJ easier to write, the scoring rules are slightly modified.** Each test point is scored independently. Each line is scored independently. If that line is the same as the standard answer, you can get 1 point. If your output has fewer than 10 lines, we will add empty lines at the end of your output to make it 10 lines. If your output has more than 10 lines, we will take the first 10 lines as the output. Translated by ChatGPT 5