Problem A
Permuted Arithmetic Sequence
An arithmetic sequence is a list of values where the
difference between consecutive values is always the same. For
example,
Input
Input begins with an integer,
Output
For each sequence, output a line that says “arithmetic” if the sequence is an arithmetic sequence. Output “permuted arithmetic” if the sequence can be reordered to make an arithmetic sequence. Otherwise, output “non-arithmetic”.
Sample Input 1 | Sample Output 1 |
---|---|
3 5 1 2 3 4 5 3 20 6 13 4 5 9 15 19 |
arithmetic permuted arithmetic non-arithmetic |