#C13582. Find Missing Numbers in a Range
Find Missing Numbers in a Range
Find Missing Numbers in a Range
Given a sequence of numbers, the task is to determine the missing numbers that complete the range between the minimum and maximum values in the list. In other words, if the list is S with m = min(S) and M = max(S), you need to output all integers x where \( m \le x \le M \) but \( x \notin S \), in increasing order.
If the input contains any non-integer values, output Invalid input
. If there are no missing numbers, print an empty line.
inputFormat
The input is given via standard input (stdin) as a single line containing space-separated tokens. Each token should represent an integer. If the input is empty, treat it as an empty list.
outputFormat
Output the missing numbers as space-separated integers to standard output (stdout). If no numbers are missing, output an empty line. If the input is invalid (i.e. contains non-integer tokens), output Invalid input
.
1 3 5 4
2