TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
n = int(input())

l = len(str(n))
# if n < 10:
#     ans = n
# else:
ans1 = 9 * (l-1) + int(str(n)[0]) - 1
ans2 = sum([int(x) for x in list(str(n))])
ans = max(ans1, ans2)
# print(ans1, ans2)
print(ans)

A, B, C, K = list(map(int, input().split()))

if K % 2 != 0:
    r = B - A
else:
    r = A - B

if abs(r) > 10 ** 18:
    print('Unfair')
else:
    print(r)

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,c,k = iim()
print((a-b)*(-1)**(k-1))

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,c,k = iim()
k = k%2
print(int((a-b)*(-1)**(k-1)))

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,c,k = iim()
k = k%2
print(int((a-b)*(-1)**k))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A, B, C, K = map(int, input().split())

if K % 2 == 0:
    ans = B - A
    if abs(ans) > 10**18:
        print("Unfair")
    else:
        print(ans)
else:
    ans = A - B
    if abs(ans) > 10**18:
        print("Unfair")
    else:
        print(ans)

A, B, C, K = map(int, input().split())

if K % 2 == 1:
    ans = B - A
    if abs(ans) > 10**18:
        print("Unfair")
    else:
        print(ans)
else:
    ans = A - B
    if abs(ans) > 10**18:
        print("Unfair")
    else:
        print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
n=int(input())
a=[]
for i in range(n):
     a.append([int(input()),i+1])
a=sorted(a,key=lambda x:x[0])

ans=0
count=0
bef=0
for i,j in a:
    if j>bef:
        count+=1
        ans=max(ans,count)
    else:
        count=1
    bef=j
print(n-ans)

a,b,c,k=map(int,input().split())
if abs(a-b)>10**18: print('Unfair')
else:
    if k%2 ==0:
        print(a-b)
    else:print(b-a)

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
print('Unfair')

A, B, C, K = map(int, input().split())


if K % 2 == 0:
    print(A-B)
else:
    print(B-A)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k=map(int,input().split())
if a-b>10**18:
  print("Unfair")
else:
  if k%2==1:
    print(a-b)
  else:
    print(b-a)
  


a,b,c,k=map(int,input().split())
if a-b>10**18:
  print("Unfair")
else:
  if k%2=1:
    print(a-b)
  else:
    print(b-a)
  


a,b,c,k=map(int,input().split())
if a-b>10**8:
  print("Unfair")
else:
  print(a-b if k%2=1 else b-a)
  


a,b,c,k=map(int,input().split())
if a-b>10**18:
  print("Unfair")
else:
  if k%2==0:
    print(a-b)
  else:
    print(b-a)
  


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k = map(int, input().split())
print(a-b) if k % 2 else print(b-a)

a,b,c,k = map(int, input().split())
print(b-a) if k % 2 else print(a-b)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
import math
A, B, C, K = map(int, input().split())

end = int(math.log2(10**18))

for _ in range(end+1):
    A, B, C = B+C, A+C, A+B
    if abs(A-B) > 10**18:
        print("Unfair")
        exit()

print(A-B)

import math
A, B, C, K = map(int, input().split())

abs_ans = abs(A-B)

if A <= B:
    if K % 2 == 0:
        print(-abs_ans)
    else:
        print(abs_ans)
else:
    if K % 2 == 0:
        print(abs_ans)
    else:
        print(-abs_ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
import sys
input = sys.stdin.readline

A, B, C, K, = map(int, input().split())
    
print(A - B)

import sys
input = sys.stdin.readline

A, B, C, K, = map(int, input().split())

if K % 2 == 0:
    if A < B:
        print(A - B)
    else:
        print(abs(A - B))
else:
    print(A - B)

import sys
input = sys.stdin.readline

L = [int(v) for v in input().split()]

if L[3] % 2 == 0:
    print(L[0] - L[1])
else:
    print(L[1] - L[0])

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
# import math
# import statistics
#a=input()
#b,c=int(input()),int(input())
# c=[]

#    c.append(i)
e1,e2,e3 ,e4= map(int,input().split())
#K = input()
# f = list(map(int,input().split()))
#g = [input() for _ in range(a)]

if e4%2==0:
    print(-(e1-e4))
elif e4%2==1:
    print(e1-e2)
elif abs(e1-e2)>=10**18:
    print("Unfair")

# import math
# import statistics
#a=input()
#b,c=int(input()),int(input())
# c=[]

#    c.append(i)
e1,e2,e3 ,e4= map(int,input().split())
#K = input()
# f = list(map(int,input().split()))
#g = [input() for _ in range(a)]

if e4%2==0:
    print(-(e1-e2))
elif e4%2==1:
    print(e1-e2)
elif abs(e1-e2)>=10**18:
    print("Unfair")

# import math
# import statistics
#a=input()
#b,c=int(input()),int(input())
# c=[]

#    c.append(i)
e1,e2,e3 ,e4= map(int,input().split())
#K = input()
# f = list(map(int,input().split()))
#g = [input() for _ in range(a)]

if e4%2==0 or e4==0:
    print(e1-e2)
elif e4%2==1 :
    print(-(e1-e2))
elif abs(e1-e2)>=10**18:
    print("Unfair")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
import math

a, b, c, k = map(int, input().split())

if k % 2 != 1:
    print(a - b if abs(math.log10(a-b)) <= 18 else "Unfair")
else:
    print(b - a if abs(math.log10(a-b)) <= 18 else "Unfair")


import math

a, b, c, k = map(int, input().split())

if k % 2 != 1:
    if a-b == 0:
        print(0)
    else:
        print(a - b if abs(math.log10(abs(a-b))) <= 18 else "Unfair")
else:
    if a-b == 0:
        print(0)
    else:
        print(b - a if abs(math.log10(abs(a-b))) <= 18 else "Unfair")


Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A,B,C,K = (int(i) for i in input().split())

if K==0:
    ans = B-A
elif K==1:
    tmpA = A
    tmpB = B
    A = B+C
    B= tmpA + C
    C = tmpA + tmpB
    ans = B-A
else:
    ans = 0

print(ans)

A,B,C,K = (int(i) for i in input().split())


if K%2 == 0:
    ans = A-B
else:
    ans = B-A

if ans>10**18:
    print("Unfair")
else:
    print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k=map(int,input().split())
print((a-b)*(-1)**(k-1))

a,b,c,k=map(int,input().split())
print((a-b)*(-1)**k)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
n = int(input())
seq = []
for i in range(n):
 k=int(input())
 seq.append(k)
i=0
count =0
while i<n:
 k=i+1
 while k<n:
     if seq[k]-seq[i]==k-i:
         count = count + 1
     k=k+1
 i=i+1

print(n-count)

a, b, c, k = map(int, input().split())
d=(a-b)*(-1)**k

if abs(d) < 10**18:
 print (d)
else:
 print('Unfair')

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,n = [int(i) for i in input().split()]

if n%2 == 1:
    print((a-b) if (a-b) < 10**18 else 'Unfair')
else:
    print(abs(a-b) if abs((a-b)) < 10**18 else 'Unfair')


a,b,c,n = [int(i) for i in input().split()]

if n%2 == 1:
    print(a-b if abs((a-b)) < 10**18 else 'Unfair')
else:
    print(b-a if abs((a-b)) < 10**18 else 'Unfair')


a,b,c,n = [int(i) for i in input().split()]

if n%2 == 1:
    print((a-b) if (a-b) <= 10**18 else 'Unfair')
else:
    print(abs(a-b) if abs((a-b)) <= 10**18 else 'Unfair')


a,b,c,n = [int(i) for i in input().split()]

if n%2 == 1:
    print(b-a if abs(b-a) < 10**18 else 'Unfair')
else:
    print(a-b if abs(a-b) < 10**18 else 'Unfair')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
N = int( input())
A = [ int( input()) for _ in range(N)]
now = 0
ans = 0
if A[0] != 0:
    ans = -1
else:
   for i in range(1,N):
       a = A[i]
       # if a > i:
       #     ans = -1
       #     break
       #el
       if now + 1 == a:
           ans += 1
           now += 1
       elif now >= a:
           ans += a
           now = a
       else:
           ans = -1
           break
print(ans)


a, b, c, k = map( int, input().split())
if k%2 == 0:
    print(a-b)
else:
    print(b-a)

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k = map(int,input().split())

x = abs(a-b)
if x > 10**18:
    print('Unfair')
else:
    print(a-b)

a,b,c,k = map(int,input().split())

x = abs(a-b)
if x > 10**18:
    print('Unfair')
else:
    if k % 2 == 0:
        print(a - b)
    else:
        print(b-a)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a, b, c, k = map(int, input().split())

if result >=th:
    print("Unfair")
elif k == 0:
    print(a - b)
else:
    print(b - a)

a, b, c, k = map(int, input().split())

if abs(a - b) >= 10e18:
    print("Unfair")
elif k//2 == 0:
    print(a - b)
else:
    print(b - a)

a, b, c, k = map(int, input().split())

if abs(a - b) >=th:
    print("Unfair")
elif k == 0:
    print(a - b)
else:
    print(b - a)

a, b, c, k = map(int, input().split())

if abs(a - b) >= 10e18:
    print("Unfair")
elif k%2 == 0:
    print(a - b)
else:
    print(b - a)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a, b, c, k = map(int, input().split())
memo = []
def culc(n, aa, bb, cc):
    global a
    global b
    global c
    if abs(a*aa+b*bb+c*cc - a*bb+b*aa+c*cc) > 10**18:
        print("Unfair")
        return 10**18
    if n == k:
        return a*aa+b*bb+c*cc - (a*bb+b*aa+c*cc)

    if n % 2 == 1:
        return culc(n+1, (aa-1)*2, bb*2+1, cc*2+1)
    else:    
        return culc(n+1, (aa+1)*2, bb*2-1, cc*2-1)

ans = culc(0, 1, 0, 0)
if ans < 10**18:
    print(ans)



a, b, c, k = map(int, input().split())
if abs(a-b) > 10**18:
    print("Unfair")
elif k % 2 == 0:
    print(a-b)
else:
    print(b-a)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
import numpy as np

line = input()

N = int(line)
A = np.array([0]*N)

for i in range(N):
    line = input()
    A[i] = int(line)

    
def IsNotPossible(A):
    foo = 0
    
    if A[0] != 0:
        foo = 1
        return foo
        
    else:
        for i in range(N-1):
            if A[i] + 1 < A[i+1]:
                foo  = 1
                break
        return foo

if IsNotPossible(A):
    print(-1)
    
else:
    count = 0
    for i in range(N-1):
        a = A[N-1-i]
        
        if a == 0:
            continue
        elif a == A[N-2-i] + 1:
            count += 1
        else:
            count += a
            
    print(count)

line = input()

N = int(line)
A = np.array([0]*N)

for i in range(N):
    line = input()
    A[i] = int(line)

def IsNotPossible(A):
    foo = 0
    
    if A[0] != 0:
        foo = 1
        
    else:
        for i in range(N-1):
            if A[i] + 1 < A[i+1]:
                foo  = 1
                break
    
    return foo

if IsNotPossible(A):
    print(-1)
    
else:
    count = 0
    for i in range(N-1):
        a = A[N-1-i]
        
        if a == 0:
            continue
        elif a == A[N-2-i] + 1:
            count += 1
        else:
            count += a
            
    print(count)

line = input()

N = int(line)
A = np.array([0]*N)

for i in range(N):
    line = input()
    A[i] = int(line)

    
def IsNotPossible(A):
    foo = 0
    
    if A[0] != 0:
        foo = 1
        return foo
        
    else:
        for i in range(N-1):
            if A[i] + 1 < A[i+1]:
                foo  = 1
                break
        return foo

if IsNotPossible(A):
    print(-1)
    
else:
    count = 0
    for i in range(N-1):
        a = A[N-1-i]
        
        if a == 0:
            continue
        elif a == A[N-2-i] + 1:
            count += 1
        else:
            count += a
            
    print(count)

line = input().split()

A = int( line[0] )
B = int( line[1] )
C = int( line[2] )
K = int( line[3] )

if K % 2 == 0:
    print(A-B)
    
else:
    print(B-A)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k = map(int, input().split())

ans = a - b

if(k % 2 == 1):
    ans = abs(ans)

if(len(ans) >= 18):
    ans = 'Unfair'

print(ans)

a,b,c,k = map(int, input().split())

ans = a - b

if(k % 2 == 1):
    ans = b - a

print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A, B, C, K = map(int, input().split())

if A == B == C:
    print(0)
else:  
    for _ in range(K):
        a = B + C
        b = A + C
        c = A + C
        A = a
        B = b
        C = c

    if A - B > 10e18:
        print('Unfair')
    else:
        print(A)

A, B, C, K = map(int, input().split())

if K % 2 == 0:
    if A - B > 10e18:
        print('Unfair')
    else:
        print(A - B)
else:
    if B - A > 10e18:
        print('Unfair')
    else:
        print(B - A)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k = map(int,input().split())
print(a-b if a-b < 10**18 else "unfair")

a,b,c,k = map(int,input().split())
if abs(a-b) < 10**18:
    if k%2==0:
        print(b-a)
    else:
        print(a-b)
else:
    print("unfair")

a,b,c,k = map(int,input().split())
if abs(a-b) < 10**18:
    if k%2==1:
        print(b-a)
    else:
        print(a-b)
else:
    print("unfair")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A,B,C,K = map(int,input().split())
Ans = 0
if K%2==1:
    Ans = (B-A
else:
    Ans = A-B
print(Ans if Ans <= 10**18 else "Unfair")

A,B,C,K = map(int,input().split())
Ans = 0
if K%2==1:
    Ans = B-A
else:
    Ans = A-B
print(Ans if Ans <= 10**18 else "Unfair")

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A = list(map(int,input().split()))
if A[3] == 0 or A[3]%2 == 0:
    print(A[0]-A{1])
else:
    print(A[1]-A[0])

A = list(map(int,input().split()))
if A[3] == 0:
    print(A[0]-A[1])
elif A[3]%2 == 0:
    print(A[0]-A[1])
else:
    print(A[1]-A[0])

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A, B, C, K = map(int, input().split())
if K % 2 == 1:
    print(A-B)
else:
    print(B-A)

A, B, C, K = map(int, input().split())
print(A-B)

A, B, C, K = map(int, input().split())
if K % 2 == 1:
    print(B-A)
else:
    print(A-B)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
from sys import exit

A, B, C, K = map(int, input().split())


if A == B:
    print(0)
    exit()

if abs(A - B) > 10 ** 18:
    print("Unfair")
    exit()

sign = (A - B) // abs(A - B)

print(A, B, C, sign)

if K % 2 == 0:
    print(abs(A - B) * sign)
else:
    print(abs(A - B) * sign * (-1))


from sys import exit

A, B, C, K = map(int, input().split())


if A == B:
    print(0)
    exit()

if abs(A - B) > 10 ** 18:
    print("Unfair")
    exit()

sign = (A - B) // abs(A - B)


if K % 2 == 0:
    print(abs(A - B) * sign)
else:
    print(abs(A - B) * sign * (-1))


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
print('Unfair')

A, B, C, K = map(int, input().split())
print(B - A) if(K % 2) else print(A - B)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A,B,C,K = map(int,input().split())
N = [A,B,C]
N2 = N[:]
for i in range(K):
    N2[0] = N[1] + N[2]
    N2[1] = N[0] + N[2]
    N2[2] = N[0] + N[1]
    N = N2.copy
print(N2)
ans = N2[0] - N2[1]
if abs(ans) > 10**18:
    print('Unfair')
else:
    print(ans)

a,b,c,k = map(int, input().split())
cheak = 10**18
ans = a-b
def calc(a,b,c,k):
    if a == b:
        return 0
    elif ans < 0:
        if k % 2 == 1:
            return -ans
        else:
            return ans
    else:
        if k % 2 == 1:
            return -ans
        else:
            return ans
ans_n = calc(a,b,c,k)
if ans_n > cheak:
    print("Unfair")
else:
    print(ans_n)


Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A,B,C,K = map(int,input().split())
if(K%2 == 0): ans = A-B
else: ans = B-A
#if(abs(ans) > 10**8): 
#else: print(ans)
print('Unfair')

A,B,C,K = map(int,input().split())
if(K%2 == 0): ans = A-B
else: ans = B-A
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A, B, C, K = map(int, input().split())
for i in range(K):
	temp_a = A
	temp_b = B
	temp_c = C
	print(A, B, C)
	A = temp_b + temp_c
	B = temp_a + temp_c
	C = temp_a + temp_b
if abs(A - B) <= 10 ** 18:
	print(A - B)
else:
	print("unfair")

A, B, C, K = map(int, input().split())
if K % 2 != 0:
	res = B - A
else:
	res = A - B
if res >= 10 ** 18:
	print("Unfair")
else:
	print(res)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k = list(map(int,input().split()))	

 if result > 10 **18:
    print("Unfair")
elif k % 2 == 0:
    print(result)
elif l % 2 == 1:
    result = result * -1
    print(result)

a,b,c,k = list(map(int,input().split()))	
x = 10 **18
result = a - b
if result > x:
    print("Unfair")
elif k % 2 == 0:
    print(result)
elif k % 2 == 1:
    result = result * -1
    print(result)


Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a, b, c, k = map(int, input().split())
if k % 2 == 0:
  ans = a-b
else:
  ans = b-a

a, b, c, k = map(int, input().split())
if k % 2 == 0:
  ans = a-b
else:
  ans = b-a
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
# 0:a, b, c, a-b
# 1:b+c, a+c, a+b, b-a
# 2:2a+b+c, a+2b+c, a+b+2c, a-b
# 3:2a+3b+3c, 3a+2b+3c, 3a+3b+2c, b-a
# 4:6a+5b+5c, 5a+6b+5c, 5a+5b+6c, a-b
A, B, C, K = [int(x) for x in input().strip().split()]
ans = (a-b)*-1**(K%2)
if ans > 10 ** 18:
  print('Unfair')
else:
  print(ans)
  

# 0:a, b, c, a-b
# 1:b+c, a+c, a+b, b-a
# 2:2a+b+c, a+2b+c, a+b+2c, a-b
# 3:2a+3b+3c, 3a+2b+3c, 3a+3b+2c, b-a
# 4:6a+5b+5c, 5a+6b+5c, 5a+5b+6c, a-b
A, B, C, K = [int(x) for x in input().strip().split()]
ans = (A-B)*(-1)**(K%2)
if ans > 10 ** 18:
  print('Unfair')
else:
  print(ans)


Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
if K%2 == 0:
    ans = A - B 
else:
    ans = B - A
print(ans)

A,B,C,K = map(int,input().split())

if K%2 == 0:
    ans = A - B 
else:
    ans = B - A
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
s=input().split()
print((int(s[0])-int(s[1]))*(-1)**s[3])

s=input().split()
print((int(s[0])-int(s[1]))*(-1)**int(s[3]))

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A, B, C, K = map(int, input().split())

if K % 2 == 0:
    print(B-A)
else:
    print(A-B)

A, B, C, K = map(int, input().split())

if K % 2 == 0:
    print(A-B)
else:
    print(B-A)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a, b, c, k = map(int, input().split())
ans = a -b
if abs(ans) > 1e18 :
    print("Unfair")
elif k % 2 == 1 :
    print(ans)
else :
    print(-ans)


a, b, c, k = map(int, input().split())
ans = a - b
if abs(ans) > 1e18 :
    print("Unfair")
elif k % 2 == 0 :
    print(ans)
else :
    print(-ans)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k=map(int,input().input())
print((a-b)*(-1)**k)

a,b,c,k=map(int,input().split())
print((a-b)*(-1)**k)

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):

n = int(input())
p = [int(input()) for _ in range(n)]


lsi = list(0 for _ in range(n+1))

for i in range(n):
    num = p[i]
    lsi[num] = 1

    for j in range(num):
        if j + lsi[j] == num:
            lsi[j] += 1

print(n - max(lsi))



a, b, c, k = map(int, input().split())

if k % 2 == 0:
    if a - b > pow(10,18):
        print("Unfair")
    else:
        print(a - b)
else:
    if b - a > pow(10,18):
        print("Unfair")
    else:
        print(b - a)


Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k=map(int,input().split())
print((b-a)*(-1)**k%2==0)

a,b,c,k=map(int,input().split());print((-1)**(k%2==0)*(b-a))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
import math
a, b, c, k = map(int, input().split())

print(a - b)

		

import math
a, b, c, k = map(int, input().split())

if k % 2 == 0:
	print(a - b)
else:
	print(b - a)

		

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k =map(int,input().split())
if abs(a-b) >= 10**8:
  print("Unfair")
else:
  print(a-b if k%2==0 else b-a)0

a,b,c,k =map(int,input().split())
if abs(a-b) > 10**18:
  print("Unfair")
else:
  print(a-b if k%2==0 else b-a)


Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
import math

a, b, c, k = list(map(int, input().split()))

for i in range(k):
  m = b + c
  n = a + c
  o = a + b
  a = m
  b = n
  c = o

if math.fabs(a - b) > 1.0e18:
  print("Unfair")
else:
  print(math.fabs(int(a - b)))


a, b, c, k = list(map(int, input().split()))

diff = (a - b) * ((-1) ** k)

if diff > 1.0e18:
  print("Unfair")
else:
  print(diff)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
inputs = split(input())
ans = inputs[0] - inputs[1] if inputs[3] % 2 == 0 else inputs[1] - inputs[0]
if ans > 10**18:
  print("Unfair")
else:
  print(ans)

inputs = [int(c) for c in input().split()]
ans = inputs[0] - inputs[1] if inputs[3] % 2 == 0 else inputs[1] - inputs[0]
if ans > 10**18:
  print("Unfair")
else:
  print(ans)


Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a, b, c, k = map(int, input().split())

for i in range(10**18):
    A = a
    B = b
    C = c
    a = B + C
    b = A + C
    c = A + B
    if i = k - 1:
        break
if abs(a - b) <= 10**18:
    print(a - b)
else:
    print('Unfair')

a, b, c, k = map(int, input().split())
x = a - b
if x > 10**18:
    print('Unfair')
elif k % 2 == 0:
    print(x)
else:
    print(-x)

Verdicts: Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
def resolve():
    '''
    code here
    '''
    A, B, C, K = [int(item) for item in input().split()]

    if K % 2 == 0:
        res = B - A
    else:
        res = A -B


    print(A-B)
if __name__ == "__main__":
    resolve()


def resolve():
    '''
    code here
    '''
    A, B, C, K = [int(item) for item in input().split()]

    if K % 2 == 0:
        res = B - A
    else:
        res = A -B


    print(res)
if __name__ == "__main__":
    resolve()


def resolve():
    '''
    code here
    '''
    A, B, C, K = [int(item) for item in input().split()]

    if K > 0:
        if K % 2 == 0:
            res = B - A
        else:
            res = A -B
    else:
        res = A -B

    print(A-B)
if __name__ == "__main__":
    resolve()


def resolve():
    '''
    code here
    '''
    A, B, C, K = [int(item) for item in input().split()]

    if K % 2 == 0:
        res = A- B
    else:
        res = B -A

    print(res)
if __name__ == "__main__":
    resolve()


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
A, B, C, K = map(int, input().split())

print(A-B)


A, B, C, K = map(int, input().split())

sub = A - B
if K % 2 == 1:
    sub *= -1
print(sub)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k=map(int,input().split())

if k%2 == 0:
  if abs(a-b)<=10**18:print(a-b)
elif ans(b-a)<=10**18:print(b-a)
else:print("Unfair")   

a,b,c,k=map(int,input().split())

if k%2 == 0:
  if abs(a-b)<=10**18:print(a-b)
elif ans(b-a)<=10*18:print(b-a)
else:print("Unfair")   

a,b,c,k=map(int,input().split())

if k%2 == 0:
  if abs(a-b)<=10**18:print(a-b)
  else:print("Unfair")
else:
    if ans(b-a)<=10*18:print(b-a)
    else:print("Unfair")

a,b,c,k=map(int,input().split())

if k%2 == 0 and abs(a-b)<=10**8:print(a-b)
elif k%2 != 0 abs(b-a)<=10**8:print(b-a)
else:print("Unfair")

a,b,c,k=map(int,input().split())

if k%2 == 0 and abs(a-b)<=10**18:print(a-b)
elif k%2 != 0 and ans(b-a)<=10**18:print(b-a)
else:print("Unfair")

a,b,c,k=map(int,input().split())

if k%2 == 0:
  if abs(a-b)<=10**18:print(a-b)
  else:print("Unfair")
   
else:
    if ans(b-a)<=10*18:print(b-a)
    else:print("Unfair")

a,b,c,k=map(int,input().split())

if k%2 == 0 and abs(a-b)<=10**18:print(a-b)
elif k%2 != 0 and abs(b-a)<=10**18:print(b-a)
else:print("Unfair")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
import sys
A,B,C,K = map(int, input().split())

ans_lis = [A,B,C]

for i in range(K):
    if K==0:
        print((ans_lis[0])-(ans_lis[1]))
        break
    ans_lis2 =[0,0,0]
    ans_lis2[0] = ans_lis[1] + ans_lis[2]
    ans_lis2[1] = ans_lis[0] + ans_lis[2]
    ans_lis2[2] = ans_lis[1] + ans_lis[0] 

    ans_lis = ans_lis2
    
    if abs((ans_lis[0]) - (ans_lis[1])) < 10**18:
        print("Unfair")
        break
    
    if i == K-1:
        print((ans_lis[0]) - (ans_lis[1]))
        break

A, B, C, K = map(int, input().split())
if K % 2 == 0:
    print(A - B)
else:
    print(B - A)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k = map(int,input().split())
count = 0
if k = 0:
  print(a-b)
  exit()

while count = k:
  a1 = a
  b1 = b
  c1 = c
  a = b1+c1
  b = a1+c1
  c = a1+b1
  count +=1
print(a-b)


a,b,c,k = map(int,input().split())
count = 0
if k == 0:
  if abs(a-b) >= 10**8:
    print('Unfair')
  else:
    print(a-b)
  exit()

while count == k:
  a1 = a
  b1 = b
  c1 = c
  a = b1 + c1
  b = a1 + c1
  c = a1 + b1
  count += 1
if abs(a-b) >= 10**8:
  print('Unfair')
else:
  print(a-b)


a,b,c,k = map(int,input().split())
count = 0
while count == k:
  a1 = a
  b1 = b
  c1 = c
  a = b1 + c1
  b = a1 + c1
  c = a1 + b1
  count += 1
if abs(a-b) >= 10**8:
  print('Unfair')
else:
  print(a-b)

a,b,c,k = map(int,input().split())
if k % 2 == 0:
  print(a-b)
else:
  print(b-a)


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively. After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:    * Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.  However, if the absolute value of the answer exceeds 10^{18}, print `Unfair` instead.

Submission attempts (in order):
a,b,c,k = map(int,input().split())
if (k % 2 == 0):
    ans = b-a
else:
    ans = a - b
if (ans > 10**18):
    print('Unfair')
else:
    print(ans)


a,b,c,k = map(int,input().split())
if (k % 2 == 0):
    ans = a-b
else:
    ans = b-a
if (ans > 10**18):
    print('Unfair')
else:
    print(ans)


Verdicts: Wrong Answer

Accepted