N=eval(input())

A=list(map(int, input().split()))

B=list(range(1,N+1))

 

C=[]

for x,y in zip(A,B):

	C.append(x-y)



C.sort()



m=0

if len(C)%2==1:

	m=C[len(C)/2]

else:

	m=(C[len(C)/2-1]+C[len(C)/2])/2



	

t=0

for x in C:

	t+=abs(-1*m+x)

print(t)

N=eval(input())

A=list(map(int, input().split()))

B=list(range(1,N+1))

 

C=[]

for x,y in zip(A,B):

	C.append(x-y)



C.sort()



m=0

if len(C)%2==1:

	m=C[len(C)/2]

else:

	m=(C[len(C)/2-1]+C[len(C)/2])/2



	

ans=0

for x in C:

	ans+=abs(-1*m+x)

print(ans)

N = eval(input())
A = list(map(int, input().split()))
B = list(range(1, N + 1))
C = []
for x, y in zip(A, B):
    C.append(x - y)
C.sort()
m = 0
if len(C) % 2 == 1:
    m = C[len(C) / 2]
else:
    m = (C[len(C) / 2 - 1] + C[len(C) / 2]) / 2
t = 0
for x in C:
    t += abs(-1 * m + x)
print(t)

N = eval(input())
A = list(map(int, input().split()))
B = list(range(1, N + 1))
C = []
for x, y in zip(A, B):
    C.append(x - y)
C.sort()
m = 0
if len(C) % 2 == 1:
    m = C[len(C) / 2]
else:
    m = (C[len(C) / 2 - 1] + C[len(C) / 2]) / 2
ans = 0
for x in C:
    ans += abs(-1 * m + x)
print(ans)

-t = 0 +ans = 0 -    t += abs(-1 * m + x) -print(t) +    ans += abs(-1 * m + x) +print(ans)