N=int(eval(input()))//2

A=sorted(a-i-1 for i,a in enumerate(map(int,input().split())))

print((sum(abs(a-A[N])for a in A)))
N=int(eval(input()))

A=sorted(a-i for i,a in enumerate(map(int,input().split())))

print((sum(A[N//2:])-sum(A[:-~N//2])))
N = int(eval(input())) // 2
A = sorted(a - i - 1 for i, a in enumerate(map(int, input().split())))
print((sum(abs(a - A[N]) for a in A)))

N = int(eval(input()))
A = sorted(a - i for i, a in enumerate(map(int, input().split())))
print((sum(A[N // 2 :]) - sum(A[: -~N // 2])))

-N = int(eval(input())) // 2 -A = sorted(a - i - 1 for i, a in enumerate(map(int, input().split()))) -print((sum(abs(a - A[N]) for a in A))) +N = int(eval(input())) +A = sorted(a - i for i, a in enumerate(map(int, input().split()))) +print((sum(A[N // 2 :]) - sum(A[: -~N // 2])))