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):
da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
  
if da[3] % 2 == 1:
  k = da[1] -da[0]
else:
  k = da[0] -da[1]

if abs(da[0] - da[1]) < l:
  print(da[0] - da[1])
elif abs(da[0] - da[1]) >= l:
  print("Unfair")

da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
 
def aaa(d,a,t):
  k = [0]*3
  k[0] = d + a
  k[1] = d + t
  k[2] = a + t
  return k
 
for i in range(da[3]):
  if da[0] == da[1] and da[1] == da[2]:
    break
  da = aaa(da[0],da[1],da[2])
  if abs(da[0] -da[1]) >= l:
    break
  elif abs(2(da[0] -da[1])) < l or m == 1:
    m = 1
    break
 
if abs(da[0] - da[1]) < l:
  print(da[0] - da[1])
elif abs(da[0] - da[1]) >= l:
  print("Unfair")


da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
  
if da[3] % 2 == 1:
  k = da[1] -da[0]
else:
  k = da[0] -da[1]

elif abs(da[0] - da[1]) < l:
  print(da[0] - da[1])
elif abs(da[0] - da[1]) >= l:
  print("Unfair")

da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
  
if da[3] % 2 == 1:
  k = da[1] -da[0]
else:
  k = da[0] -da[1]

if abs(da[0] - da[1]) <= l:
  print(da[0] - da[1])
elif abs(da[0] - da[1]) > l:
  print("Unfair")

da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
 
if da[3] <= 65 and da[0] != da[1]:
  m=1
 
def aaa(d,a,t):
  k = [0]*3
  k[0] = d + a
  k[1] = d + t
  k[2] = a + t
  return k
 
for i in range(da[3]):
  if da[0] == da[1]:
    break
  da = aaa(da[0],da[1],da[2])
  if abs(da[0] -da[1]) >= l or m == 1:
    break
if da[0] == da[1]:
  print("0")
elif abs(da[0] - da[1]) < l:
  print(da[0] - da[1])
elif abs(da[0] - da[1]) >= l:
  print("Unfair")

da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
 
def aaa(d,a,t):
  k = [0]*3
  k[0] = d + a
  k[1] = d + t
  k[2] = a + t
  return k
 
for i in range(da[3]):
  if da[0] == da[1] and da[1] == da[2]:
    break
  da = aaa(da[0],da[1],da[2])
  if abs(da[0] -da[1]) >= l:
    break
  elif abs(2(da[0] -da[1])) < l or m == 1:
    m = 1
    break
 
if abs(da[0] - da[1]) < pow(10,18):
  print(da[0] - da[1])
elif abs(da[0] - da[1]) >= pow(10,18):
  print("Unfair")

da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)

if da[3] <= 65 and da[0] != da[1]:
  m=1
 
def aaa(d,a,t):
  k = [0]*3
  k[0] = d + a
  k[1] = d + t
  k[2] = a + t
  return k
 
for i in range(da[3]):
  if da[0] == da[1]:
    break
  da = aaa(da[0],da[1],da[2])
  if abs(da[0] -da[1]) >= l or m == 1:
    break
 
if abs(da[0] - da[1]) < l:
  print(da[0] - da[1])
elif abs(da[0] - da[1]) >= l:
  print("Unfair")

da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
 
if da[3] <= 65 and da[0] != da[1]:
  m=1
 
def aaa(d,a,t):
  k = [0]*3
  k[0] = d + a
  k[1] = d + t
  k[2] = a + t
  return k
 
for i in range(da[3]):
  if da[0] == da[1]:
    break
  da = aaa(da[0],da[1],da[2])
  if abs(da[0] -da[1]) >= l or m == 1:
    break
if da[0] == da[1]:
  print(0)
 
elif abs(da[0] - da[1]) < l:
  print(da[0] - da[1])
elif abs(da[0] - da[1]) >= l:
  print("Unfair")

da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
  
if da[3] % 2 == 1:
  k = da[1] -da[0]
else:
  k = da[0] -da[1]

if abs(da[0] - da[1]) <= l:
  print(k)
elif abs(da[0] - da[1]) > l:
  print("Unfair")

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted