#K54432. Sequence Classification

    ID: 29752 Type: Default 1000ms 256MiB

Sequence Classification

Sequence Classification

In this problem, you are given one or more sequences of integers. For each sequence, determine if it is strictly increasing, strictly decreasing, or neither. A sequence is considered strictly increasing if every element is greater than the previous one, and strictly decreasing if every element is less than the previous one. Otherwise, the sequence is classified as "Neither".

Input is provided via standard input and consists of multiple test cases. For each test case, you first receive an integer N denoting the number of elements in the sequence, followed by a line containing N space-separated integers.

Output, via standard output, should be a single line for each test case indicating the type of the sequence: "Increasing", "Decreasing", or "Neither".

Note: Please ensure your solution reads from standard input and writes to standard output. Any mathematical formulas, if needed, should be provided in ( \LaTeX ) format.

inputFormat

The first line contains an integer T, the number of test cases. For each test case:

  • The first line contains an integer N, indicating the number of elements in the sequence.
  • The second line contains N space-separated integers representing the sequence.

outputFormat

For each test case, output one line containing one of the following strings:

  • "Increasing" if the sequence is strictly increasing.
  • "Decreasing" if the sequence is strictly decreasing.
  • "Neither" otherwise.## sample
3
5
1 2 3 4 5
4
10 8 6 2
6
3 3 5 4 2 1
Increasing

Decreasing Neither

</p>