ZhenlongDai/ACPR huggingface dataset:
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A_s = list(map(int,input().split()))
X_s = []
X_s.append(sum(A_s)-2*sum(A_s[1::2]))
for i,a in enumerate(A_s):
  X_s.append(2*A_s[i]-X_s[i])
print(' '.join(map(str,X_s)))

Failing test case input:
3
0000000000 1110000010 0

Expected output:
-1110000010 1110000010 1110000010


Actual output:
-1110000010 1110000010 1110000010 -1110000010


Fixed submission (verdict: Accepted):
N = int(input())
A_s = list(map(int,input().split()))
X_s = []
X_s.append(sum(A_s)-2*sum(A_s[1::2]))
for i,a in enumerate(A_s):
  X_s.append(2*A_s[i]-X_s[i])
X_s.pop()
print(' '.join(map(str,X_s)))

Problem: p02984
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
A_array = list(map(int,input().split()))

water_sum = sum(A_array) 

now_water = water_sum - sum(A_array[1::2]) * 2
ans_array = []
print(now_water)
ans_array.append(str(now_water))
for i in range(N-1):
    now_water = A_array[i] * 2 - now_water
    ans_array.append(str(now_water))

print(" ".join(ans_array))

Failing test case input:
3
1000000010 1000100010 0

Expected output:
-100000 2000100020 100000


Actual output:
-100000
-100000 2000100020 100000


Fixed submission (verdict: Accepted):
N = int(input())
A_array = list(map(int,input().split()))

water_sum = sum(A_array) 

now_water = water_sum - sum(A_array[1::2]) * 2
ans_array = []

ans_array.append(str(now_water))
for i in range(N-1):
    now_water = A_array[i] * 2 - now_water
    ans_array.append(str(now_water))

print(" ".join(ans_array))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

s = sum(a)

x1 = s - 2 * (sum(a[1::2]))  
x = [x1]
for i in range(2, n + 1):
    x.append(2 * a[i - 2] - x[i - 2])

print(x)


Failing test case input:
3
1001001100 1011101000 0

Expected output:
-10099900 2012102100 10099900


Actual output:
[-10099900, 2012102100, 10099900]


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

s = sum(a)

x1 = s - 2 * (sum(a[1::2]))  
x = [x1]
for i in range(2, n + 1):
    x.append(2 * a[i - 2] - x[i - 2])

print(*x)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
A = A + A
all_neg = sum(A)

res = []
for i in range(N):
    res_tmp = 0
    for j, a in enumerate(A[i:i+N]):
        res_tmp += a if j % 2 == 0 else -a
    res.append(res_tmp)
print(res)


Failing test case input:
3
1010100100 1011100100 0

Expected output:
-1000000 2021200200 1000000


Actual output:
[-1000000, 2021200200, 1000000]


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
res = ""
res_tmp = 0
for j, a in enumerate(A):
    res_tmp += a if j % 2 == 0 else -a
res += (str(res_tmp) + " ")

for i, a in enumerate(A[:-1]):
    res_tmp = -res_tmp + a*2
    res += (str(res_tmp) + " ")
print(res[:-1])
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
x=a[n-1]
for i in range(0,n-2,2):
	x += a[i] - a[i+1]
x /= 2
m = [x]
for t in range(n-1):
	m.append(a[t]-m[t])
m = [int(mountain * 2) for mountain in m]
print(m)









Failing test case input:
3
0000000000 1010100000 0

Expected output:
-1010100000 1010100000 1010100000


Actual output:
[-1010100000, 1010100000, 1010100000]


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
x=a[n-1]
for i in range(0,n-2,2):
	x += a[i] - a[i+1]
x /= 2
m = [x]
for t in range(n-1):
	m.append(a[t]-m[t])
m = [str(int(mountain * 2)) for mountain in m]
print(' '.join(m))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
l_a = list(map(int,input().split()))
print(l_a[1::2])
b_x = sum(l_a) - sum(l_a[1::2])*2
l_x =[b_x]
for s in range(N-1):
    x = l_a[s]*2 - b_x
    l_x.append(x)
    b_x = x
print(l_x)


Failing test case input:
3
2 0 6

Expected output:
8 -4 4


Actual output:
[0]
[8, -4, 4]


Fixed submission (verdict: Accepted):
N = int(input())
l_a = list(map(int,input().split()))
b_x = sum(l_a) - sum(l_a[1::2])*2
l_x =[b_x]
for s in range(N-1):
    x = l_a[s]*2 - b_x
    l_x.append(x)
    b_x = x
print(*l_x)

Problem: p02984
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())

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

odd = sum([dams[x]*(-1)**x for x in range(n)])
even = sum([-1 * dams[x]*(-1)**x for x in range(n)])
out = str(odd)
origin = {
  0: odd,
  1: even
}

for i in range(1, n):
  ans = origin[i%2] + 2 * dams[i]
  out += " " + str(ans)
  
print(out)
  

Failing test case input:
3
1000001000 1010101000 0

Expected output:
-10100000 2010102000 10100000


Actual output:
-10100000 2030302000 -10100000


Fixed submission (verdict: Accepted):
n = int(input())

dams = list(map(int, input().split()))
ans_list = [0 for x in range(n)]

ans_list[0] = sum([dams[x]*(-1)**x for x in range(n)])

for i in range(1, n):
  ans_list[i] = -ans_list[i-1] + 2 * dams[i - 1]

print(" ".join(list(map(str, ans_list))))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
x=[]
for i in range(n):
    x.append(int(0))
s = sum(a)
x[0] = s -2*(sum(a[1:n:2]))
for i in range(0,n-1):
    x[i+1] = 2*a[i]-x[i]
print(x)

Failing test case input:
3
1010100100 1011100100 0

Expected output:
-1000000 2021200200 1000000


Actual output:
[-1000000, 2021200200, 1000000]


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
x=[]
for i in range(n):
    x.append(int(0))
s = sum(a)
x[0] = s -2*(sum(a[1:n:2]))
for i in range(0,n-1):
    x[i+1] = 2*a[i]-x[i]
print(*x)
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
b = []

b.append(sum(a) - 2*sum(a[1:n-1]))
i = 0
while i < n-1:
    b.append(2*a[i]-b[i])
    i += 1

print(*b)

Failing test case input:
5
3 8 1 5 5

Expected output:
-4 10 6 -4 14


Actual output:
-6 12 4 -2 12


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
b = []

b.append(sum(a) - 2*sum(a[1:n-1:2]))
i = 0
while i < n-1:
    b.append(2*a[i]-b[i])
    i += 1

print(*b)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))
T = sum(A)
print(T-2*sum(A[1:N-1]),end=" ") 
for i in range(1,N):
    print(T-2*(sum(A[0:i-1])+sum(A[i+1:N])),end=" ")

Failing test case input:
5
3 4 1 5 5

Expected output:
0 6 2 0 10


Actual output:
-2 -4 -8 -6 2 

Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))
X = []
X.append(sum(A)-2*sum(A[1::2]))
print(X[0],end=" ")
for i in range(1,N):
    X.append(A[i-1]*2-X[i-1])
    print(X[i],end=" ")

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

a = 0
for i in range(N):
  a += A[i] * (1 if not i%2 else -1)
print(a)

ans = [0] * N
ans[0] = a

for i in range(1, N):
  ans[i] = 2 * A[i-1] - ans[i-1]

print(*ans)

Failing test case input:
3
1000000000 1001101000 0

Expected output:
-1101000 2001101000 1101000


Actual output:
-1101000
-1101000 2001101000 1101000


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

a = 0
for i in range(N):
  a += A[i] * (1 if not i%2 else -1)

ans = [0] * N
ans[0] = a

for i in range(1, N):
  ans[i] = 2 * A[i-1] - ans[i-1]

print(*ans)
print()

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
List = []
List.append(sum(a[0::2])-sum(a[1::2]))
for i in range(n-1):
	List.append(2 * a[i]-List[i])
print(List)

Failing test case input:
3
1000010000 1010000000 0

Expected output:
-9990000 2010010000 9990000


Actual output:
[-9990000, 2010010000, 9990000]


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
List = []
List.append(sum(a[0::2])-sum(a[1::2]))
for i in range(n-1):
	List.append(2 * a[i]-List[i])
print(' '.join(map(str,List)))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

print(A[0], A[-1])
x1 = sum(A) - 2 * (sum(A) - int(A[0]) - int(A[-1]))

x = []
x.append(x1)
for i in range(N-1):
    x.append(2 * A[i] - x[i])

print(' '.join(map(str, x)))


Failing test case input:
3
1000000000 1000100010 0

Expected output:
-100010 2000100010 100010


Actual output:
1000000000 0
-100010 2000100010 100010


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
X = [0] * N

X[0] = sum(A) - 2 * (sum([A[i] for i in range(N) if i % 2 == 1]))

for i in range(N - 1):
    X[i + 1] = 2 * A[i] - X[i]

print(" ".join(map(str, X)))
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    x = sum(A) - 2 * sum(A[i] for i in range(1, N, 2))
    ans = [x]
    for i in range(N - 1):
        x = 2 * A[i] - x
        ans.append(x)
    print(ans)


main()


Failing test case input:
3
1000000000 1010000000 0

Expected output:
-10000000 2010000000 10000000


Actual output:
[-10000000, 2010000000, 10000000]


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    x = sum(A) - 2 * sum(A[i] for i in range(1, N, 2))
    ans = [str(x)]
    for i in range(N - 1):
        x = 2 * A[i] - x
        ans.append(str(x))
    print(' '.join(ans))


main()

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(zz) for zz in input().split()]
B = [0]*N

tmp = 0
for i in range(N):
    if i%2 == 0:
        tmp += A[i]*2
    else:
        tmp -= A[i]*2

B[0] = int(tmp/2)
for i in range(1,N):
    B[i] = A[i-1]*2 - B[i-1]

[print(i, end='') for i in B]


Failing test case input:
3
0000100000 0001101000 0

Expected output:
-1001000 1201000 1001000


Actual output:
-100100012010001001000

Fixed submission (verdict: Accepted):
N = int(input())
A = [int(zz) for zz in input().split()]
B = [0]*N

tmp = 0
for i in range(N):
    if i%2 == 0:
        tmp += A[i]*2
    else:
        tmp -= A[i]*2

B[0] = int(tmp/2)
for i in range(1,N):
    B[i] = A[i-1]*2 - B[i-1]

[print(i, end=' ') for i in B]

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math
import heapq
import bisect

MOD = 10**9+7

N = int(input())


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

B = [0]*N
for i in range(N):
    if i%2 == 0:
        B[0] += A[i]
    else:
        B[0] -= A[i]

for i in range(1,N):
    B[i] = 2*(A[i-1]-B[i-1]/2)

for b in B:
    print(b)

Failing test case input:
3
0000000000 1110000000 0

Expected output:
-1110000000 1110000000 1110000000


Actual output:
-1110000000
1110000000.0
1110000000.0


Fixed submission (verdict: Accepted):

import math
import heapq
import bisect

MOD = 10**9+7

N = int(input())


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

B = [0]*N
for i in range(N):
    if i%2 == 0:
        B[0] += A[i]
    else:
        B[0] -= A[i]

for i in range(1,N):
    B[i] = 2*(A[i-1]-B[i-1]

for b in B:
    print(b)
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
a2 = list(map(lambda x:x*2,a))
All = sum(a)
p = All-sum(a2[1::2])
a3 = [p]
for i in range(n-1) :
    q = a[i]*2 - p
    a3.append(q)
mountain = ""
for j in range(n) :
    mountain += str(a3[j])
    if j == n-1 :
        print(mountain)
        exit()
    mountain += " "

Failing test case input:
3
1011001000 1011101100 0

Expected output:
-100100 2022102100 100100


Actual output:
-100100 2022102100 2022302300


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
a2 = list(map(lambda x:x*2,a))
All = sum(a)
p = All-sum(a2[1::2])
a3 = [p]
for i in range(n-1) :
    p = a[i]*2 - p
    a3.append(p)
mountain = ""
for j in range(n) :
    mountain += str(a3[j])
    if j == n-1 :
        print(mountain)
        exit()
    mountain += " "

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=[int(i) for i in input().split()]
M=[0]*n
M[0]=sum(a[i]*(-1)**i for i in range(n))
for i in range(1,n):
    M[i]=2*a[i-1]-M[i-1]
print(M)

Failing test case input:
3
0010000000 1010001010 0

Expected output:
-1000001010 1020001010 1000001010


Actual output:
[-1000001010, 1020001010, 1000001010]


Fixed submission (verdict: Accepted):
n=int(input())
a=[int(i) for i in input().split()]
M=[0]*n
M[0]=sum(a[i]*(-1)**i for i in range(n))
for i in range(1,n):
    M[i]=2*a[i-1]-M[i-1]
print(*M)

Problem: p02984
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
M = [sum(A)] * N
for j in range(N):
    for i in range(1, N, 2):
        M[j] -= A[(i + j) % N] * 2
print(M)


Failing test case input:
3
1000101000 1010000000 0

Expected output:
-9899000 2010101000 9899000


Actual output:
[-9899000, 2010101000, 9899000]


Fixed submission (verdict: Accepted):
import math
import sys

input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
X = [sum(A)] * N
for i in range(2, N, 2):
    X[0] -= 2 * A[i - 1]
for i in range(1, N):
    X[i] = 2 * A[i - 1] - X[i - 1]
print(*X)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
answer = [0] * N

totalRain = sum(A)

answer[0] = totalRain
for i in range(1,N-1):
    answer[0]-=A[i]*2


for i in range(1, N-1):
    if i+1 != N:
        answer[i+1] = (A[i]*2) - answer[i]

print(answer[0], end="")
for i in range(1, N):
    print("",answer[i], end="")

Failing test case input:
3
1010100000 1011101000 0

Expected output:
-1001000 2021201000 1001000


Actual output:
-1001000 0 2022202000

Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
answer = [0] * N

totalRain = sum(A)

answer[0] = totalRain
for i in range(1,N-1,2):
    answer[0]-=A[i]*2


for i in range(N-1):
    if i+1 != N:
        answer[i+1] = (A[i]*2) - answer[i]

print(answer[0], end="")
for i in range(1, N):
    print("",answer[i], end="")
Problem: p02984
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
t = sum(A)
B = [0] * N
for i in range(0, N, 2):
  B[0] += A[i]
B[0] = 2 * B[0] - t
print(B[0])

for i in range(1,N):
  B[i] = 2 * A[i-1] - B[i-1]

for i in range(N):
  print(B[i],end=" ")

Failing test case input:
3
1011000000 1011111000 0

Expected output:
-111000 2022111000 111000


Actual output:
-111000
-111000 2022111000 111000 

Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
t = sum(A)
B = [0] * N
for i in range(0, N, 2):
  B[0] += A[i]
B[0] = 2 * B[0] - t

for i in range(1,N):
  B[i] = 2 * A[i-1] - B[i-1]

for i in range(N):
  print(B[i],end=" ")

Problem: p02984
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

N = int(input())
A_list = list(map(int, input().split()))
x_list = [0] * N
x_list[0] = sum(A_list) - sum([2*a for a in A_list[1::2]])
for i, a in enumerate(A_list[:-1]):
    x_list[i+1] = 2*a - x_list[i]

print(x_list)

Failing test case input:
3
1000100000 1000000000 0

Expected output:
100000 2000100000 -100000


Actual output:
[100000, 2000100000, -100000]


Fixed submission (verdict: Accepted):

N = int(input())
A_list = list(map(int, input().split()))
x_list = [0] * N
x_list[0] = sum(A_list) - sum([2*a for a in A_list[1::2]])
for i, a in enumerate(A_list[:-1]):
    x_list[i+1] = 2*a - x_list[i]

print(*x_list)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
S = sum(A)

X = [0]*N
X[0] = S-2*(S-A[0]-A[-1])

for i in range(1, N):
  X[i] = 2*A[i-1]-X[i-1]
print(*X)

Failing test case input:
5
3 8 7 5 5

Expected output:
2 4 12 2 8

Actual output:
-12 18 -2 16 -6


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
S = sum(A)

X = [0]*N
X[0] = S-2*(S-sum(A[0::2]))

for i in range(1, N):
  X[i] = 2*A[i-1]-X[i-1]
print(*X)

Problem: p02984
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
A=list(map(int,input().split()))
X=[0]*n
X[0]=(A[0]-A[1]+A[2])
for i in range(1,n):
  X[i]=A[i-1]-X[i-1]
for i in range(n):
  X[i]*=2
print(*X)

Failing test case input:
3
0010001000 1110000000 0

Expected output:
-1099999000 1120001000 1099999000


Actual output:
-2199998000 2220000000 0


Fixed submission (verdict: Accepted):
n=int(input())
A=list(map(int,input().split()))
X=[0]*n
S=sum(A)
A2=0
for i in range(1,n-1,2):
  A2+=A[i]
X[0]=S-2*A2
for i in range(1,n):
  X[i]=2*A[i-1]-X[i-1]
print(*X)
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

print(A[0], A[-1])
x1 = sum(A) - 2 * (sum(A) - int(A[0]) - int(A[-1]))

x = []
x.append(x1)
for i in range(N-1):
    x.append(2 * A[i] - x[i])

print(x)


Failing test case input:
3
1001001100 1011101100 0

Expected output:
-10100000 2012102200 10100000


Actual output:
1001001100 0
[-10100000, 2012102200, 10100000]


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
X = [0] * N

X[0] = sum(A) - 2 * (sum([A[i] for i in range(N) if i % 2 == 1]))

for i in range(N - 1):
    X[i + 1] = 2 * A[i] - X[i]

print(" ".join(map(str, X)))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

x = [None] * N
x[0] = 2 * (A[0] + A[-1]) - sum(A)
for i in range(N-1):
    x[i+1] = 2 * A[i] - x[i]
print(" ".join(map(str, x)))

Failing test case input:
5
3 4 1 5 5

Expected output:
0 6 2 0 10


Actual output:
-2 8 0 2 8


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

x = [None] * N
x[0] = sum(A) - 2 * sum([a for a in A[1::2]])
for i in range(N-1):
    x[i+1] = 2 * A[i] - x[i]
print(" ".join(map(str, x)))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

x = [None] * N
x[0] = sum(A) - sum([a for a in A[2::2]])
for i in range(N-1):
    x[i+1] = 2 * A[i] - x[i]
print(" ".join(map(str, x)))

Failing test case input:
3
0010000000 1110100010 0

Expected output:
-1100100010 1120100010 1100100010


Actual output:
1120100010 -1100100010 3320300030


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

x = [None] * N
x[0] = sum(A) - 2 * sum([a for a in A[1::2]])
for i in range(N-1):
    x[i+1] = 2 * A[i] - x[i]
print(" ".join(map(str, x)))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
x = [0] * N
y = [0] * N

for i, A in enumerate(input().split()):
  x[i] = int(A)
  
for i in range(N):
  for j in range(i, i+N):
    index = j % N
    y[i] += ((-1) ** index) *  x[index]
    
str_y = map(str, y)
output = " ".join(str_y)
print(output)

Failing test case input:
3
1000000001 1001100000 1

Expected output:
-1099998 2001100000 1100000


Actual output:
-1099998 -1099998 -1099998


Fixed submission (verdict: Accepted):
N = int(input())
x = list(map(int, input().split()))
y = [0] * N

odd = sum([n for i, n in enumerate(x) if i % 2 == 1])
even = sum([n for i, n in enumerate(x) if i % 2 == 0])
y[0] = even - odd

for i in range(N-1):
  y[i+1] = 2 * x[i] - y[i]


str_y = map(str, y)
output = " ".join(str_y)
print(output)
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
lst = list(map(int,input().split()))
ans = []
some = 0
for i in range(n):
    some += lst[i]*(((-1)**i))/2
for i in range(n):
    if i == 0:
        ans.append(str(int(some)))
    else:
        ans.append(str(int(lst[i-1]-int(ans[i-1]))))
print(" ".join(ans))

Failing test case input:
3
0000000000 1111000010 0

Expected output:
-1111000010 1111000010 1111000010


Actual output:
-555500005 555500005 555500005


Fixed submission (verdict: Accepted):
n = int(input())
lst = list(map(int,input().split()))
ans = []
some = 0
for i in range(n):
    some += lst[i]*(((-1)**i))
for i in range(n):
    if i == 0:
        ans.append(str(int(some)))
    else:
        ans.append(str(2*int(lst[i-1]-int(ans[i-1])/2)))
print(" ".join(ans))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().strip().split()))
X = []
X.append(sum(A[0::2])-sum(A[1::2]))
for k in range (N-1):
  X.append(2*A[k] - X[k])
print(X)

Failing test case input:
3
1010000000 0011101000 0

Expected output:
998899000 1021101000 -998899000


Actual output:
[998899000, 1021101000, -998899000]


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().strip().split()))
X = []
X.append(sum(A[0::2])-sum(A[1::2]))
for k in range (N-1):
  X.append(2*A[k] - X[k])
print(*X, sep=" ")

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

suma = sum(a)
suma2 = sum([a[x] for x in range(1,n,2)])
b = [suma-suma2*2]
for i in range(1,n):
    b.append(a[i-1]*2-b[i-1])
print(b)

Failing test case input:
3
0000001000 1111100000 0

Expected output:
-1111099000 1111101000 1111099000


Actual output:
[-1111099000, 1111101000, 1111099000]


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

suma = sum(a)
suma2 = sum([a[x] for x in range(1,n,2)])
b = [suma-suma2*2]
for i in range(1,n):
    b.append(a[i-1]*2-b[i-1])
print(*b)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))

x1 = sum(A) - 2 * sum(A[1::2])
print(A[1::2])
print(x1, end=' ')
for i in range(N-1):
    x1 = 2 * A[i] - x1
    print(x1, end=' ')

Failing test case input:
3
1001001100 1011101100 0

Expected output:
-10100000 2012102200 10100000


Actual output:
[1011101100]
-10100000 2012102200 10100000 

Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))

x1 = sum(A) - 2 * sum(A[1::2])
print(x1, end=' ')
for i in range(N-1):
    x1 = 2 * A[i] - x1
    print(x1, end=' ')
print()
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

S = sum(A)
x1 = S - 2 * sum([A[i] for i in range(len(A)) if i % 2 == 1])
ansList = [x1]
for i, a in enumerate(A[1:]):
    tmp = 2 * a - ansList[0]
    ansList.append(tmp)
ansList = [str(a) for a in ansList]
ans = ' '.join(ansList)
print(ans)

Failing test case input:
3
1000010000 1010000000 0

Expected output:
-9990000 2010010000 9990000


Actual output:
-9990000 2029990000 9990000


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

S = sum(A)
x1 = S - 2 * sum([A[i] for i in range(len(A)) if i % 2 == 1])
ansList = [x1]
for i in range(1, N):
    tmp = 2 * A[i-1] - ansList[-1]
    ansList.append(tmp)
ansList = [str(a) for a in ansList]
ans = ' '.join(ansList)
print(ans)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))

x = [-1]*n

x[0] = 0
for i in range(n):
    x[0] += (-1)**(i+2) * a[i]

for i in range(1,n):
    x[i] = 2*a[i-1]-x[i-1]

print(x)

Failing test case input:
3
1010000000 1010000000 0

Expected output:
0 2020000000 0


Actual output:
[0, 2020000000, 0]


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))

x = [-1]*n

x[0] = 0
for i in range(n):
    x[0] += (-1)**(i+2) * a[i]

for i in range(1,n):
    x[i] = 2*a[i-1]-x[i-1]



for i in range(n):
    print(x[i],end=" ")

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))


x1 = sum(A) - 2 * (sum(A) - int(A[0]) - int(A[-1]))

x = []
x.append(x1)
for i in range(N-1):
    x.append(2 * A[i] - x[i])

print(' '.join(map(str, x)))


Failing test case input:
5
3 8 7 5 5

Expected output:
2 4 12 2 8

Actual output:
-12 18 -2 16 -6


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
X = [0] * N

X[0] = sum(A) - 2 * (sum([A[i] for i in range(N) if i % 2 == 1]))

for i in range(N - 1):
    X[i + 1] = 2 * A[i] - X[i]

print(" ".join(map(str, X)))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
X = []

x0 = sum(A)
for i in range(1,N-1,2):
    x0 = x0-2*A[i]
X.append(x0)

for i in range(N-1):
    X.append(2*A[i]-X[i])
    
print(X)

Failing test case input:
3
1000100000 1000000000 0

Expected output:
100000 2000100000 -100000


Actual output:
[100000, 2000100000, -100000]


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
X = []

x0 = sum(A)
for i in range(1,N-1,2):
    x0 = x0-2*A[i]
X.append(x0)

for i in range(N-1):
    X.append(2*A[i]-X[i])
    
print(" ".join(map(str,X)))
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(i) for i in input().split()]
X = [0] * N
sum_A = sum(A)
sum_subA = 0
for i in range(1, N, 2):
    sum_subA += 2 * A[i]
X[0] = sum_A - sum_subA
for i in range(1, N):
    X[i] = 2 * A[i - 1] - X[i-1]
print(X)

Failing test case input:
3
1000010000 1011101000 0

Expected output:
-11091000 2011111000 11091000


Actual output:
[-11091000, 2011111000, 11091000]


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(i) for i in input().split()]
X = [0] * N
sum_A = sum(A)
sum_subA = 0
for i in range(1, N, 2):
    sum_subA += 2 * A[i]
X[0] = sum_A - sum_subA
for i in range(1, N):
    X[i] = 2 * A[i - 1] - X[i-1]
print(*X)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))

X1by2 = 0
for i in range(N):
  if i%2 ==0:
    X1by2 += A[i]
  else:
    X1by2 -= A[i]

X = []

X.append(X1by2)
for i in range(1,len(A)):
  X.append((A[i]-X1by2/2)*2)

print(" ".join(repr(int(e)) for e in X))

Failing test case input:
3
0000001000 1110000000 0

Expected output:
-1109999000 1110001000 1109999000


Actual output:
-1109999000 3329999000 1109999000


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))

X1by2 = 0
for i in range(N):
  if i%2 ==0:
    X1by2 += A[i]
  else:
    X1by2 -= A[i]

X = []

X.append(X1by2)
for i in range(len(A)-1):
  X.append((A[i]-X[i]/2)*2)

print(" ".join(repr(int(e)) for e in X))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
a = input().split()
b = list(map(int, a))
sum = sum(b)

X = [0]*num
X1 = 0
for i in range(num):
  if((2*i+1) >= num):
    break
  X1 = b[2*i+1] + X1
X[0] = sum - 2 * X1

for i in range(1,num):
  X[i] = b[i-1]*2 - X[i-1]
print(X)

Failing test case input:
3
1000000000 0000100000 0

Expected output:
999900000 1000100000 -999900000


Actual output:
[999900000, 1000100000, -999900000]


Fixed submission (verdict: Accepted):
num = int(input())
a = input().split()
b = list(map(int, a))
sum = sum(b)

X = [0]*num
X1 = 0
for i in range(num):
  if((2*i+1) >= num):
    break
  X1 = b[2*i+1] + X1
X[0] = sum - 2 * X1

for i in range(1,num):
  X[i] = b[i-1]*2 - X[i-1]
print(" ".join(map(str, X)))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
s=[]
for i in range(1,n+1):
    if i%2==0:
        s.append(a[i])
A=sum(a)
ans=[0]*n
ans[0]=A-sum(s)
for i in range(1,n):
    ans[i]=2*a[i-1]-ans[i-1]
print(*ans)

Failing test case input:
3
0000001000 1110000000 0

Expected output:
-1109999000 1110001000 1109999000


Actual output:
1110001000 -1109999000 3329999000


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
s=[]
for i in range(1,n):
    if i%2==1:
        s.append(a[i])
A=sum(a)
ans=[0]*n
ans[0]=A-2*sum(s)
for i in range(1,n):
    ans[i]=2*a[i-1]-ans[i-1]
print(*ans)
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
a2 = list(map(lambda x:x*2,a))
All = sum(a)
p = All-sum(a2[1::2])
a3 = [p]
for i in range(n-1) :
    q = a[i]*2 - p
    a3.append(q)
mountain = ""
for j in range(n) :
    mountain += str(a3[j])
    mountain += " "
print(mountain)

Failing test case input:
3
1011001000 1011101100 0

Expected output:
-100100 2022102100 100100


Actual output:
-100100 2022102100 2022302300 


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
a2 = list(map(lambda x:x*2,a))
All = sum(a)
p = All-sum(a2[1::2])
a3 = [p]
for i in range(n-1) :
    p = a[i]*2 - p
    a3.append(p)
mountain = ""
for j in range(n) :
    mountain += str(a3[j])
    if j == n-1 :
        print(mountain)
        exit()
    mountain += " "

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
x = [0] * N
y = [0] * N

for i, A in enumerate(input().split()):
  x[i] = int(A)
  
for i in range(N):
  for j in range(N):
    index = (i + j) % N
    y[i] += ((-1) ** j) *  x[index]
    print("y[{}]:{}".format(i, y[i]))
    
str_y = map(str, y)
output = " ".join(str_y)
print(output)

Failing test case input:
3
1010000000 1010000000 0

Expected output:
0 2020000000 0


Actual output:
y[0]:1010000000
y[0]:0
y[0]:0
y[1]:1010000000
y[1]:1010000000
y[1]:2020000000
y[2]:0
y[2]:-1010000000
y[2]:0
0 2020000000 0


Fixed submission (verdict: Accepted):
N = int(input())
x = list(map(int, input().split()))
y = [0] * N

odd = sum([n for i, n in enumerate(x) if i % 2 == 1])
even = sum([n for i, n in enumerate(x) if i % 2 == 0])
y[0] = even - odd

for i in range(N-1):
  y[i+1] = 2 * x[i] - y[i]


str_y = map(str, y)
output = " ".join(str_y)
print(output)

Problem: p02984
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())

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

memo = 0

for i in range(1, n):
    if i%2==0:
        continue
    else:
        memo += t[i]
x1 = sum(t)-2*memo

print(x1)

res = []

res.append(x1)

for i in range(1, n):
    res.append(2*t[i-1]-res[i-1])
print(' '.join(map(str,res)))

Failing test case input:
3
1000000000 1100100000 0

Expected output:
-100100000 2100100000 100100000


Actual output:
-100100000
-100100000 2100100000 100100000


Fixed submission (verdict: Accepted):
n=int(input())

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

memo = 0

for i in range(1, n):
    if i%2==0:
        continue
    else:
        memo += t[i]
x1 = sum(t)-2*memo

res = []

res.append(x1)

for i in range(1, n):
    res.append(2*t[i-1]-res[i-1])
    
print(' '.join(map(str,res)))
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = list(map(int,input().split()))

x = sum(A)
for i in range(1,n,2):
    print(i)
    x -= 2*A[i] 

print(x,end=" ")

for i in range(n-1):
    x = 2*A[i]-x
    print(x,end=" ")


Failing test case input:
3
1000000000 1000000000 0

Expected output:
0 2000000000 0

Actual output:
1
0 2000000000 0 

Fixed submission (verdict: Accepted):
n = int(input())
A = list(map(int,input().split()))

x = sum(A)
for i in range(1,n,2):
    x -= 2*A[i] 

print(x,end=" ")

for i in range(n-1):
    x = 2*A[i]-x
    print(x,end=" ")

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
Mt = [0] * N

for i in range(N):
    Mt[0] += A[i] * (-1) ** i

for i in range(1, N):
    Mt[i] = 2 * A[i - 1] - Mt[i-1]

print(Mt)


Failing test case input:
3
1000010000 1010000000 0

Expected output:
-9990000 2010010000 9990000


Actual output:
[-9990000, 2010010000, 9990000]


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
Mt = [0] * N

for i in range(N):
    Mt[0] += A[i] * (-1) ** i

for i in range(1, N):
    Mt[i] = 2 * A[i - 1] - Mt[i-1]

print(*Mt)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
dam = 0
sign = 1
for mountain in a:
  dam = sign * mountain
  sign = -sign
print(dam, end=' ')
for i in range(n - 1):
  dam = 2 * a[i] - dam
  print(dam, end=' ')

Failing test case input:
3
1010100100 1010101000 0

Expected output:
-900 2020201100 900


Actual output:
0 2020200200 1800 

Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
dam = 0
sign = 1
for mountain in a:
  dam += sign * mountain
  sign = -sign
print(dam, end=' ')
for i in range(n - 1):
  dam = 2 * a[i] - dam
  print(dam, end=' ')

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
s = sum(a)

x_1 = s
for i in range(1,n,2):
    x_1 -= 2*a[i]
ans = [x_1]
for i in range(1, n):
    ans.append(2*a[i-1]-ans[i-1])
print(ans)
print(" ".join(list(map(str, ans))))

Failing test case input:
3
0000001000 1101100000 0

Expected output:
-1101099000 1101101000 1101099000


Actual output:
[-1101099000, 1101101000, 1101099000]
-1101099000 1101101000 1101099000


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
s = sum(a)

x_1 = s
for i in range(1,n,2):
    x_1 -= 2*a[i]
ans = [x_1]
for i in range(1, n):
    ans.append(2*a[i-1]-ans[i-1])
print(" ".join(list(map(str, ans))))
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

sum_eve = sum(A[0::2])
sum_odd = sum(A[1::2])

x = [0] * n

x[0] = sum_eve - sum_odd

for num in range(1, n):
    x[num] = 2 * A[num-1] - x[num-1]
    
print(x)

Failing test case input:
3
1010100100 1011100100 0

Expected output:
-1000000 2021200200 1000000


Actual output:
[-1000000, 2021200200, 1000000]


Fixed submission (verdict: Accepted):
n = int(input())
A = list(map(int, input().split()))

sum_eve = sum(A[0::2])
sum_odd = sum(A[1::2])

x = [0] * n

x[0] = sum_eve - sum_odd

for num in range(1, n):
    x[num] = 2 * A[num-1] - x[num-1]
    
ans = " ".join(map(str,x))
print(ans)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = list(map(int,input().split()))

xn = 0
for i in range(n-1):
    xn = xn + (-1) ** (i+1) * int(A[i])

xn = xn + A[n-1]

x = []
x1 = 2*A[n-1]-xn
x.append(x1)

for i in range(n-1):
    xi=2*A[i]-x1
    x.append(xi)
    x1 = xi
print(x)


Failing test case input:
3
0010001000 1110100010 0

Expected output:
-1100099010 1120101010 1100099010


Actual output:
[-1100099010, 1120101010, 1100099010]


Fixed submission (verdict: Accepted):
n = int(input())
A = list(map(int,input().split()))

xn = 0
for i in range(n-1):
    xn = xn + (-1) ** (i+1) * int(A[i])

xn = xn + A[n-1]

x = []
x1 = 2*A[n-1]-xn
x.append(x1)

for i in range(n-1):
    xi=2*A[i]-x1
    x.append(xi)
    x1 = xi
print(*x)

Problem: p02984
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a=list(map(lambda x:2*int(x),input().split()))

ans=[0]*n
s=int(sum(a)/2)
for i in range(1,n,2):
    s-=a[i]
ans[0]=s
for i in range(1,n):
    ans[i]=a[i-1]-ans[i-1]
print(ans)

Failing test case input:
3
2 1 5

Expected output:
6 -2 4


Actual output:
[6, -2, 4]


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(lambda x:2*int(x),input().split()))

ans=[0]*n
s=int(sum(a)/2)
for i in range(1,n,2):
    s-=a[i]
ans[0]=s
for i in range(1,n):
    ans[i]=a[i-1]-ans[i-1]
print(*ans)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
s = sum(a)
b = []
b.append(s - 2*sum(a[1::2]))
for i in range(n-1):
    b.append(2*a[i] - b[i])
print(b)

Failing test case input:
3
1000000000 1000100000 0

Expected output:
-100000 2000100000 100000


Actual output:
[-100000, 2000100000, 100000]


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
s = sum(a)
b = []
b.append(s - 2*sum(a[1::2]))
for i in range(n-1):
    b.append(2*a[i] - b[i])
print(' '.join(map(str, b)))
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

sum_odd = sum([v for v in A[1::2]])
x0 = sum(A)-2*sum_odd
ans = [x0]

x = x0
for a in A:
    nex = 2*a-x
    ans.append(nex)
    x = nex
print(*ans)


Failing test case input:
3
1010000000 1010000000 0

Expected output:
0 2020000000 0


Actual output:
0 2020000000 0 0


Fixed submission (verdict: Accepted):
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

sum_odd = sum([v for v in A[1::2]])
x0 = sum(A)-2*sum_odd
ans = [x0]

x = x0
for a in A:
    nex = 2*a-x
    ans.append(nex)
    x = nex
print(*ans[:-1])

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
x = [0]*n
x[0] = sum(a)-2*sum(a[1:n-1])
for i in range(1, n):
    x[i] = 2*a[i-1]-x[i-1]
print(*x)

Failing test case input:
5
3 8 1 5 5

Expected output:
-4 10 6 -4 14


Actual output:
-6 12 4 -2 12


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
x = [0]*n
x[0] = sum(a)-(2*sum(a[1:n-1:2]))
for i in range(1, n):
    x[i] = 2*a[i-1]-x[i-1]
print(*x)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())
A = [int(i) for i in input().split()]


x = sum(A) - 2*sum([A[i] for i in range(1, N, 2)])
water = [x]

for i in range(N):
  x = 2*A[i] - x
  water.append(x)
  


print(*water)

Failing test case input:
3
1010100110 1010101100 0

Expected output:
-990 2020201210 990


Actual output:
-990 2020201210 990 -990


Fixed submission (verdict: Accepted):

N = int(input())
A = [int(i) for i in input().split()]


x = sum(A) - 2*sum([A[i] for i in range(1, N, 2)])
water = [x]

for i in range(N - 1):
  x = 2*A[i] - x
  water.append(x)
  


print(*water)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

Y = [sum(A) - 2 * sum(A[1::2])]
for i in range(1, N):
    Y.append(2 * A[i-1] - Y[i-1])

print(Y)


Failing test case input:
3
2 0 6

Expected output:
8 -4 4


Actual output:
[8, -4, 4]


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

Y = [sum(A) - 2 * sum(A[1::2])]
for i in range(1, N):
    Y.append(2 * A[i-1] - Y[i-1])

print(*Y)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
a = [0]*N
a[0] = sum(A) - 2*sum(map(lambda i,x: x if i%2==1 else 0, range(N), A))
for i in range(1, N):
    a[i] = 2*A[i-1]-a[i-1]
print(a)

Failing test case input:
3
1010000000 1011101000 0

Expected output:
-1101000 2021101000 1101000


Actual output:
[-1101000, 2021101000, 1101000]


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
a = [0]*N
a[0] = sum(A) - 2*sum(map(lambda i,x: x if i%2==1 else 0, range(N), A))
for i in range(1, N):
    a[i] = 2*A[i-1]-a[i-1]
print(*a)
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input()
a=[int(x) for x in input().split()]
b=sum(a)-2*sum(a[1::2])
print(sum(a))
print(sum(a[1::2]))
ans = [b]
for x in a:
    b = x*2-b
    ans.append(b)
print(*ans[:-1])

Failing test case input:
3
1000010010 1010000000 0

Expected output:
-9989990 2010010010 9989990


Actual output:
2010010010
1010000000
-9989990 2010010010 9989990


Fixed submission (verdict: Accepted):
input()
a=[int(x) for x in input().split()]
b=sum(a)-2*sum(a[1::2])


ans = [b]
for x in a:
    b = x*2-b
    ans.append(b)
print(*ans[:-1])

Problem: p02984
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
inp=list(map(int,input().split()))
inp=[2*item for item in inp]
ans=[0]
for i in range(len(inp)-1):
    ans.append(inp[i]-ans[-1])
for item in ans:
    print (item,end=" ")
print (" ")

Failing test case input:
3
0000001000 0110100000 0

Expected output:
-110099000 110101000 110099000


Actual output:
0 2000 220198000  


Fixed submission (verdict: Accepted):
n=int(input())
inp=list(map(int,input().split()))
inp=[2*item for item in inp]
s=0
for i in range(1,len(inp)):
    if i%2==1:
        s-=inp[i]
    else:
        s+=inp[i]
ans=[(s+inp[0])
for i in range(len(inp)-1):
    ans.append(inp[i]-ans[-1])
for item in ans:
    print (item,end=" ")

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a_list = list(map(int, input().split()))

ans = [0 for _ in range(n)]
sum_rain = sum(a_list)
tmp = sum_rain
for a in a_list[:-1:2]:
    tmp -= a * 2
ans[-1] = tmp
ans[0] = a_list[-1] * 2 - tmp
tmp = ans[0]
for i in range(1, n-1):
    tmp = a_list[i-1] * 2 - tmp
    ans[i] = tmp
print(ans)


Failing test case input:
3
1000000000 1000100010 0

Expected output:
-100010 2000100010 100010


Actual output:
[-100010, 2000100010, 100010]


Fixed submission (verdict: Accepted):
n = int(input())
a_list = list(map(int, input().split()))

ans = [0 for _ in range(n)]
sum_rain = sum(a_list)
tmp = sum_rain
for a in a_list[:-1:2]:
    tmp -= a * 2
ans[-1] = tmp
ans[0] = a_list[-1] * 2 - tmp
tmp = ans[0]
for i in range(1, n-1):
    tmp = a_list[i-1] * 2 - tmp
    ans[i] = tmp
print(*ans)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n=int(sys.stdin.readline())
a=list(map(int,sys.stdin.readline().split()))

x=[sum(a)-2*sum(a[1::2])]
for i in range(n-1):
    s=2*a[0]-x[i]
    x.append(s)
s=map(str,x)
print(" ".join(s))


Failing test case input:
3
1000000000 0000000000 0

Expected output:
1000000000 1000000000 -1000000000


Actual output:
1000000000 1000000000 1000000000


Fixed submission (verdict: Accepted):
import sys
n=int(sys.stdin.readline())
a=list(map(int,sys.stdin.readline().split()))

x=[sum(a)-2*sum(a[1::2])]
for i in range(n-1):
    s=2*a[i]-x[i]
    x.append(s)
s=map(str,x)
print(" ".join(s))
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N=int(input())
A=list(map(int,input().split())) 
x = [0 for i in range(N)]
S =sum(A)
x[0]=S
for i in range(1,N,2):
  x[0]-=2*A[i]

for i in range(1,N):
  x[i]=2*A[i-1]-x[i-1]
print(S)
ans= map(str,x)
print(' '.join(ans))

Failing test case input:
3
1011100100 1011101100 0

Expected output:
-1000 2022201200 1000


Actual output:
2022201200
-1000 2022201200 1000


Fixed submission (verdict: Accepted):

N=int(input())
A=list(map(int,input().split())) 
x = [0 for i in range(N)]
S =sum(A)
x[0]=S
for i in range(1,N,2):
  x[0]-=2*A[i]

for i in range(1,N):
  x[i]=2*A[i-1]-x[i-1]
ans= map(str,x)
print(' '.join(ans))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))

X1by2 = 0
for i in range(N):
  if i%2 ==0:
    X1by2 += A[i]
  else:
    X1by2 -= A[i]

X = []

X.append(X1by2)
for i in range(1,len(A)):
  X.append((A[i]-X1by2/2)*2)

print(" ".join(repr(e) for e in X))


Failing test case input:
3
0010100000 1010001010 0

Expected output:
-999901010 1020101010 999901010


Actual output:
-999901010 3019903030.0 999901010.0


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))

X1by2 = 0
for i in range(N):
  if i%2 ==0:
    X1by2 += A[i]
  else:
    X1by2 -= A[i]

X = []

X.append(X1by2)
for i in range(len(A)-1):
  X.append((A[i]-X[i]/2)*2)

print(" ".join(repr(int(e)) for e in X))

Problem: p02984
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]

x1=sum([pow(-1, i)*A[i] for i in range(N)])/2
print(2*x1, end=' ')

for i in range(1, N):
  print(2*(sum([pow(-1, k-i)*A[k] for k in range(i, N)])-pow(-1, i)*x1), end=' ')

Failing test case input:
3
1001001100 1011101000 0

Expected output:
-10099900 2012102100 10099900


Actual output:
-10099900.0 2012102100.0 10099900.0 

Fixed submission (verdict: Accepted):
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
a2 = list(map(lambda x:x*2,a))
All = sum(a)
p = All-sum(a2[1::2])
a3 = [p]
for i in range(n-1) :
    q = a[i]*2 - p
    a3.append(q)
mountain = ""
for j in range(n) :
    mountain += str(a3[j])
    if j == n-1 :
        exit()
    mountain += " "
print(mountain)

Failing test case input:
3
1000100000 1010000000 0

Expected output:
-9900000 2010100000 9900000


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
a2 = list(map(lambda x:x*2,a))
All = sum(a)
p = All-sum(a2[1::2])
a3 = [p]
for i in range(n-1) :
    p = a[i]*2 - p
    a3.append(p)
mountain = ""
for j in range(n) :
    mountain += str(a3[j])
    if j == n-1 :
        print(mountain)
        exit()
    mountain += " "
Problem: p02984
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())

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

memo = 0

for i in range(1, n):
    if i%2==0:
        continue
    else:
        memo += t[i]
x1 = sum(t)-2*memo

print(x1)

res = []

res.append(x1)

for i in range(1, n):
    res.append(2*t[i-1]-res[i-1])
print(res)

Failing test case input:
3
1000100000 1010000000 0

Expected output:
-9900000 2010100000 9900000


Actual output:
-9900000
[-9900000, 2010100000, 9900000]


Fixed submission (verdict: Accepted):
n=int(input())

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

memo = 0

for i in range(1, n):
    if i%2==0:
        continue
    else:
        memo += t[i]
x1 = sum(t)-2*memo

res = []

res.append(x1)

for i in range(1, n):
    res.append(2*t[i-1]-res[i-1])
    
print(' '.join(map(str,res)))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A_list = list(map(int, input().split()))

R1 = sum(A_list) - 2 * sum(A_list[i] for i in range(1,N,2))

Ri_list = [0] * N

Ri_list[0] = R1

for i in range(1,N):
    print(A_list[i-1])
    Ri_list[i] = A_list[i-1] * 2 - Ri_list[i-1]

for item in Ri_list:
    print(item, end=' ')

Failing test case input:
3
1100000000 1100100000 0

Expected output:
-100000 2200100000 100000


Actual output:
1100000000
1100100000
-100000 2200100000 100000 

Fixed submission (verdict: Accepted):
N = int(input())
A_list = list(map(int, input().split()))

R1 = sum(A_list) - 2 * sum(A_list[i] for i in range(1,N,2))

Ri_list = [0] * N

Ri_list[0] = R1

for i in range(1,N):
    
    Ri_list[i] = A_list[i-1] * 2 - Ri_list[i-1]

for item in Ri_list:
    print(item, end=' ')

Problem: p02984
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
MOD = 10**9+7
n = int(input())
a=[int(i) for i in input().split()]
tmp = 0
res = [0]*n
f=1
for i in a:
    tmp += f*i
    f=f*-1
res[0]=tmp

for i in range(1,n):
    res[i] = 2*a[i-1]-res[-1]
    if(i==n-1):
        res[i] = 2*a[i]-res[0]
print(*res)


Failing test case input:
3
1010011000 1011111110 0

Expected output:
-1100110 2021122110 1100110


Actual output:
-1100110 2020022000 1100110


Fixed submission (verdict: Accepted):
MOD = 10**9+7
n = int(input())
a=[int(i) for i in input().split()]
tmp = 0
res = [0]*n
f=1
for i in a:
    tmp += f*i
    f=f*-1
res[0]=tmp
res[n-1] = 2*a[n-1]-res[0]
for i in range(n-2,0,-1):
    res[i] = 2*a[i]-res[i+1]

print(*res)