[Kattis] Permuted Arithmetic Sequence

An arithmetic sequence is basically a sequence of numbers where each new term is obtained by adding a fixed number to the last one.