#K11876. Sequence Type Determination
Sequence Type Determination
Sequence Type Determination
Given a sequence of integers, determine whether it is strictly increasing, strictly decreasing, or neither.
A sequence \(\{a_i\}\) is said to be strictly increasing if \(a_i < a_{i+1}\) for all valid indices, and strictly decreasing if \(a_i > a_{i+1}\) for all valid indices. Otherwise, the sequence is considered neither.
The input consists of multiple lines. Each line represents a sequence of space-separated integers. The input terminates with a line containing only the string "end". For every sequence (except the terminating line), output its type on a separate line.
inputFormat
Input is provided via standard input (stdin) as multiple lines. Each line (except the last terminal line) contains a space-separated list of integers representing a sequence. The final line contains the string "end" to signal the end of input.
outputFormat
For each sequence in the input (excluding the terminal line "end"), print a single line with one of the following outputs:
increasing
if the sequence is strictly increasingdecreasing
if the sequence is strictly decreasingneither
otherwise
1 2 3 4 5
end
increasing
</p>