Arithmetic Array Codeforces Solution