Buggy python submission (verdict: Runtime Error):
N = int(input())
v = [int(_) for _ in input().split()]

import numpy as np

# v = [8, 3, 3, 4, 10]
# N = len(v)

A = np.zeros((N, N))
for i in range(N):
    A[(i - 1) % N][i] = 1 / 2
    A[i][i] = 1 / 2

ans = np.dot(np.linalg.inv(A), v)
ans = [int(x) for x in ans]
print(*ans)

Fixed submission:
import sys
import numpy as np
def input():
    return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    a = [int(e) for e in input().split()]

    x = [0 for _ in range(n)]
    x[0] = sum(a) - (sum(a[1:n:2]) * 2)
    for i in range(2, n, 2):
        x[i] = x[i-2] + ((a[i-1] - a[i-2]) * 2)
    x[1] = sum(a) - (sum(a[2:n:2]) * 2)
    for i in range(3, n, 2):
        x[i] = x[i-2] + ((a[i-1] - a[i-2]) * 2)
    print(*x)
main()

Buggy python submission (verdict: Runtime Error):
N = int(input())
v = [int(_) for _ in input().split()]

import numpy as np

# v = [8, 3, 3, 4, 10]
# N = len(v)

A = np.zeros((N, N))
for i in range(N):
    A[(i - 1) % N][i] = 1 / 2
    A[i][i] = 1 / 2

ans = np.dot(np.linalg.inv(A), v)
ans = [int(x) for x in ans]
print(ans)

Fixed submission:
import sys
import numpy as np
def input():
    return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    a = [int(e) for e in input().split()]

    x = [0 for _ in range(n)]
    x[0] = sum(a) - (sum(a[1:n:2]) * 2)
    for i in range(2, n, 2):
        x[i] = x[i-2] + ((a[i-1] - a[i-2]) * 2)
    x[1] = sum(a) - (sum(a[2:n:2]) * 2)
    for i in range(3, n, 2):
        x[i] = x[i-2] + ((a[i-1] - a[i-2]) * 2)
    print(*x)
main()

Buggy python submission (verdict: Runtime Error):
N = int(input())
v = [int(_) for _ in input().split()]

import numpy as np

# v = [2,2,4]
# N = len(v)

A = np.zeros((N, N))
for i in range(N):
    A[(i - 1) % N][i] = 1 / 2
    # A[i][(i - 1) % N] = 1 / 2
    A[i][i] = 1 / 2

# print(A)
# print(np.linalg.inv(A))
ans = np.dot(np.linalg.inv(A), v)
ans = [int(x) for x in ans]
print(ans)

Fixed submission:
import sys
import numpy as np
def input():
    return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    a = [int(e) for e in input().split()]

    x = [0 for _ in range(n)]
    x[0] = sum(a) - (sum(a[1:n:2]) * 2)
    for i in range(2, n, 2):
        x[i] = x[i-2] + ((a[i-1] - a[i-2]) * 2)
    x[1] = sum(a) - (sum(a[2:n:2]) * 2)
    for i in range(3, n, 2):
        x[i] = x[i-2] + ((a[i-1] - a[i-2]) * 2)
    print(*x)
main()

Buggy python submission (verdict: Runtime Error):
N = int(input())
v = [int(_) for _ in input().split()]

import numpy as np

# v = [2, 2, 4]
# N = len(v)

A = np.zeros((N, N))
for i in range(N):
    # A[(i - 1) % N][i] = 1
    A[i][(i - 1) % N] = 1 / 2
    A[i][i] = 1 / 2

# print(A)
# print(np.linalg.inv(A))
ans = np.dot(np.linalg.inv(A), v)
ans = [int(x) for x in ans]
print(ans)

Fixed submission:
import sys
import numpy as np
def input():
    return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    a = [int(e) for e in input().split()]

    x = [0 for _ in range(n)]
    x[0] = sum(a) - (sum(a[1:n:2]) * 2)
    for i in range(2, n, 2):
        x[i] = x[i-2] + ((a[i-1] - a[i-2]) * 2)
    x[1] = sum(a) - (sum(a[2:n:2]) * 2)
    for i in range(3, n, 2):
        x[i] = x[i-2] + ((a[i-1] - a[i-2]) * 2)
    print(*x)
main()