Amazing Sequence
In this task, we need to check whether a given sequence is an Amazing Sequence.
Example:
Consider a sequence of 4 integers (0, 1, 4, 6). As we can see from the above figure, all the 6 differences among these 4 integers are distinct. So, this is an Amazing sequence.
Input:
The input will have 2 lines.
First line will contain the size (N) of a sequence and
The second line will contain a sequence of N integers.
Output:
The first line must contain a positive non-zero integer, N. If not, print "Error in input" and quit the program.
The second line must contain exactly N non-negative integers. If not, print "Invalid input" and quit the program.
After making sure the inputs are valid, check whether the given sequence satisfies all the conditions of an Amazing sequence. If the given sequence is an Amazing Sequence, print "It is an Amazing Sequence". Otherwise print "It is an ordinary sequence".
Sample Input1: 4 0 1 4 6 Sample output1: It is an Amazing Sequence
Sample Input2: 10 0 1 6 10 23 26 34 41 53 55 Sample output2: It is an Amazing Sequence
Sample Input3: -3 0 1 3 Sample output3: Error in input
Sample Input4: 3 0 -1 3 Sample output4: Invalid input
Sample Input5: 6 0 1 5 10 12 17 Sample output5: It is an ordinary sequence
Sample Input6: 15 0 4 20 30 57 59 76 62 100 111 123 136 144 145 151 Sample output6: It is an ordinary sequence
Sample Input7: 20 0 1 8 11 68 77 94 116 121 156 158 179 194 208 212 228 240 253 259 283 290 Sample output7: Invalid Input