#P5246. Simulated Lost Program Output

    ID: 18482 Type: Default 1000ms 256MiB

Simulated Lost Program Output

Simulated Lost Program Output

You are given an executable program (\texttt{lost}) and several input files named (\texttt{input*.txt}). For each input file, your task is to produce its corresponding output file. The program (\texttt{lost}) reads from standard input and writes to standard output, so you can use I/O redirection. An alternative executable, (\texttt{lost2}), is also provided; it reads from (\texttt{input.txt}) and writes to (\texttt{output.txt}), but its behavior is identical to (\texttt{lost}).

Note that the program (\texttt{lost}) is not perfect; when the input is too large, it may fail to run properly and will instead print the message "invalid input!". To simulate this behavior, your program should follow these rules:

  1. Read the entire input from standard input.
  2. If the total number of characters is greater than 10, output exactly "invalid input!".
  3. Otherwise, echo the input exactly without any changes.

You may choose to simulate the behavior of either (\texttt{lost}) or (\texttt{lost2}), but the behavior must match the description above.

inputFormat

Input is provided via standard input and may consist of multiple lines. You need to consider the total number of characters in the input (after removing a trailing newline, if present).

outputFormat

Output a single string. If the overall length of the input is greater than 10 characters, output "invalid input!". Otherwise, echo the input exactly.

sample

Hello
Hello