IPSC Logo

Internet Problem Solving Contest

IPSC 2002

Problem A – Andews's Exams III

Have you heard of the Irresponsible Andrew? He is a professor at the Comenius University and one of his duties is to prepare admission exams. This is the third year in a row when he prepared exam problems, but forgot to include model solutions and went to a conference (it is even possible he did this intentionally, but we do not believe he is so evil :-). Thus, the whole team of DIE (Department of Informatics Education) worked very hard to find solutions before the date of exams. However, there is only one day left and they cannot cope with two problems. They asked you for help.

Data set 1

You are given a program which reads some numbers from the standard input. The program usually runs for a long time. However, it is known that there are some inputs for which it terminates very quickly. Your task is to find an input for which the given program terminates in the time limit (0.5 seconds on Pentium 120MHz) and writes OK to the standard output.

Data set 2

You are given a program which takes no input, runs for a long time and writes the result to the standard output. Determine the output.

Input file specification

The input file contains the source code of the program from the exam written in both Pascal and C. You may assume that both versions of the program are syntactically correct, do not result in a run-time error and are equivalent.

Output file specification

The output file for the data set 1 should contain an input for the program that will result in a short run-time. The output file for the data set 2 should contain the output that the given program would produce if it ran long enough.