#K78547. Determine List Trend
Determine List Trend
Determine List Trend
You are given a list of integers. Your task is to determine whether the list is strictly increasing, strictly decreasing, or neither. Specifically, for a list \(A\) of length \(n\), if \(A_i < A_{i+1}\) for every \(1 \leq i < n\), then the list is increasing; if \(A_i > A_{i+1}\) for every \(1 \leq i < n\), then the list is decreasing; otherwise, the answer is neither.
Note: A single-element list is considered neither increasing nor decreasing.
inputFormat
The first line contains a single integer \(n\) (the number of elements in the list). The second line contains \(n\) space-separated integers representing the list.
outputFormat
Output a single string: increasing
if the list is strictly increasing, decreasing
if the list is strictly decreasing, and neither
otherwise.
5
1 2 3 4 5
increasing