#K77177. Increase List Elements by Ten

    ID: 34807 Type: Default 1000ms 256MiB

Increase List Elements by Ten

Increase List Elements by Ten

You are given a list of tokens representing integers. Your task is to increase each integer by 10 and output the result. If any token is not a valid integer, output "Invalid input".

Input Format: The input consists of two lines. The first line contains a single integer (n) ((0 \le n \le 10^5)) representing the number of elements. The second line contains (n) space-separated tokens.

Output Format: If all tokens are valid integers, output a single line with (n) space-separated integers where each integer is increased by 10. If the list is empty, output an empty line. If any token is invalid (i.e., not a valid integer), output exactly "Invalid input".

In (\LaTeX) format, the requirement can be written as follows:

$$\forall x \in A, \; x \in \mathbb{Z} \implies \text{output } x+10, \quad \text{otherwise output } \text{\"Invalid input\"}. $$

inputFormat

The first line contains a single integer (n) indicating the number of tokens. The second line contains (n) space-separated tokens, each expected to represent an integer.

outputFormat

If every token is a valid integer, print a single line of (n) space-separated integers, each increased by 10. Otherwise, if any token fails validation, print "Invalid input".## sample

3
1 2 3
11 12 13