n = int(input()) nums = list(map(int, input().split())) result = [nums[n - i - 1] - nums[i] for i in range(n // 2)] c = 0 for i in range(len(result) - 1): if result[i] * result[i + 1] > 0: d = min(result[i], result[i + 1]) if result[i] > 0 else max(result[i], result[i + 1]) result[i] -= d result[i + 1] -= d c += abs(d) c += sum(abs(i) for i in result) print(c)
0.0分
4 人评分