#K55747. Temperature Trend
Temperature Trend
Temperature Trend
You are given a sequence of integer temperatures. Your task is to determine whether the sequence is strictly increasing, strictly decreasing, or neither. A sequence is considered strictly increasing if every element is less than the next one, and strictly decreasing if every element is greater than the next one. Otherwise, the trend is considered "NEITHER".
You need to process multiple test cases. For each test case, the input starts with an integer (n) representing the number of temperature readings, followed by (n) integers representing the temperature readings. For each test case, output the trend on a new line.
Input Format:
- The first line contains an integer \(T\), the number of test cases.
- For each test case, the first line contains an integer \(n\) (the number of temperature readings), and the next line contains \(n\) space-separated integers.
Output Format:
- For each test case, output a single line containing either
INCREASING
,DECREASING
, orNEITHER
.
The solution implementations in various languages must read from stdin and write the result to stdout.
inputFormat
stdin:
- The first line contains an integer \(T\), denoting the number of test cases.
- For each test case:
- The first line contains an integer \(n\).
- The second line contains \(n\) space-separated integers representing the temperatures.
outputFormat
stdout:
- For each test case, output a single line containing
INCREASING
,DECREASING
, orNEITHER
, indicating the trend of the sequence.
1
5
1 2 3 4 5
INCREASING