ZhenlongDai/ACPR huggingface dataset:
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
     
if (A + B) % 2 == 0:
  print((A + B) / 2)
else:
  print("IMPOSSIBLE")

Failing test case input:
707160285 9274641

Expected output:
358217463


Actual output:
358217463.0


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
     
if (A + B) % 2 == 0:
  print((A + B) 
else:
  print("IMPOSSIBLE")

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



a,b=[int(s) for s in input().split()]
ans=(a-b)/2
if ans==int(ans):
    print(ans)
else:
    print('IMPOSSIBLE')

Failing test case input:
1457 62403

Expected output:
31930


Actual output:
-30473.0


Fixed submission (verdict: Accepted):



a,b=[int(s) for s in input().split()]
ans=(a+b)/2
if ans==int(ans):
    print(int(ans))
else:
    print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input1 = input()

num = input1.split(' ')

num1 = int(num[0])
num2 = int(num[1])

total = num1 + num2

if total%2 == 0:
	print('IMPOSSIBLE')
else:
	print(total/2)

Failing test case input:
819805567 9274641

Expected output:
414540104


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
input1 = input()
 
num = input1.split()
 
num1 = int(num[0])
num2 = int(num[1])
 
total = num1 + num2
 
if total%2 != 0:
	print('IMPOSSIBLE')
else:
	print(int(total/2))

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

k = (a+b)/2

if(k.is_integer()):
    print(k)
else:
    print("IMPOSSIBLE")


Failing test case input:
0 54

Expected output:
27


Actual output:
27.0


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

k = (a+b)/2

if(k.is_integer()):
    print(int(k))
else:
    print("IMPOSSIBLE")

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

if a+b % 2 == 0:
  print(int(a+b)/2)
else:
  print('IMPOSSIBLE')

Failing test case input:
190939370 25059880

Expected output:
107999625


Actual output:
IMPOSSIBLE


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

if (a+b) % 2 == 0:
  print(int((a+b)/2))
else:
  print('IMPOSSIBLE')

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

if ((a%2 == 1)and(b%2==1)):
    c = (a+b)/2
    print(c)

if ((a%2==0)and(b%2==0)):
    c =(a+b)/2
    print(c)
else:
    print("IMPOSSIBLE")

Failing test case input:
89 11409

Expected output:
5749


Actual output:
5749.0
IMPOSSIBLE


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

if ((a%2 == 1)and(b%2==1)):
    c = (a+b)/2
    print(int(c))

elif ((a%2==0)and(b%2==0)):
    c =(a+b)/2
    print(int(c))

else:
    print("IMPOSSIBLE")
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
if (a+b)%2 == 0:
  print((a+b)/2)
else:
  print('IMPOSSIBLE')


Failing test case input:
5490045 24174675

Expected output:
14832360


Actual output:
14832360.0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if (a+b)%2 == 0:
  print((a+b)
else:
  print('IMPOSSIBLE')

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

if (A + B) % 2 == 0:
  print((A + B) / 2)
else:
  print('IMPOSSIBLE')

Failing test case input:
320431836 14450182

Expected output:
167441009


Actual output:
167441009.0


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

if (A + B) % 2 == 0:
  print(int((A + B) / 2))
else:
  print('IMPOSSIBLE')

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

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

if (A+B) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print((A+B)/2)

Failing test case input:
0 54

Expected output:
27


Actual output:
27.0


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

if (A+B) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print(int((A+B)/2))

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l = list(map(int,input().split()))
a = l[0]
b = l[1]
if (a+b)%2 == 0:
  print((a+b)/2)
else:
  print('IMPOSSIBLE')


Failing test case input:
1457 62403

Expected output:
31930


Actual output:
31930.0


Fixed submission (verdict: Accepted):
l = list(map(int,input().split()))
a = l[0]
b = l[1]
if (a+b)%2 == 0:
  print((a+b)
else:
  print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int, input().split())
C=(A+B)/2
D=A+B
if D %2 > 0:
    print('IMPOSSIBLE')
elif D %2 == 0:
    print((A+B)/2)

Failing test case input:
2773903 1574255

Expected output:
2174079


Actual output:
2174079.0


Fixed submission (verdict: Accepted):
A,B = map(int, input().split())
C=(A+B)/2
D=A+B
if D %2 > 0:
    print('IMPOSSIBLE')
elif D %2 == 0:
    print((A+B)

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
if (A+B)%2 == 0:
  print((A+B)/2)
else:
  print('IMPOSSIBLE')

Failing test case input:
5490045 24174675

Expected output:
14832360


Actual output:
14832360.0


Fixed submission (verdict: Accepted):
a,b = map(int, input().split())
if (a + b) % 2 == 0:
  print((a + b) 
else:
  print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x,y = map(int,input().split())

ave = (x + y) / 2

if int(ave - int(ave) * 10) == 0:
  print(int(ave))
  exit()
print("IMPOSSIBLE")

Failing test case input:
2770031 5298487

Expected output:
4034259


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
x,y = map(int,input().split())

ave = abs(x + y) / 2

if int((ave - int(ave)) * 10) == 0:
  print(int(ave))
  exit()
print("IMPOSSIBLE")
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = list(map(int,input().split()))
if abs(a-b)%2 == 0:
    print(abs(a-b)%2+min(a,b))
else:
    print("IMPOSSIBLE")

Failing test case input:
2 94

Expected output:
48


Actual output:
2


Fixed submission (verdict: Accepted):
a,b = list(map(int,input().split()))
if abs(a-b)%2 == 0:
    print(abs(a-b)
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if (a+b)%2==0:
  print(a+b)
else:
  print("IMPOSSIBLE")

Failing test case input:
2 94

Expected output:
48


Actual output:
96


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
answer=abs((A+B)/2)

if (A-B)%2==0:
  print(answer)
else :
  print('imposible')

Failing test case input:
108741947 23304885

Expected output:
66023416


Actual output:
66023416.0


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
answer=int((A+B)/2)

if (A-B)%2==0:
  print(answer)
else :
  print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)/2)
  
else:
  print('IMPOSSIBLE')


Failing test case input:
1349313191 99824435

Expected output:
724568813


Actual output:
724568813.0


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)
  
else:
  print('IMPOSSIBLE')

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

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

if (A+B)%2==1:
  print("IMPOSSIBLE")

else:
  print((A+B)/2)

Failing test case input:
4 36

Expected output:
20


Actual output:
20.0


Fixed submission (verdict: Accepted):

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

if (A+B)%2==1:
  print("IMPOSSIBLE")

else:
  print(int((A+B)/2))

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int,input().split())
K=(A+B)/2
if (A+B)%2==0:
    print(K)
else: print("IMPOSSIBLE")
    

Failing test case input:
998244353 99824435

Expected output:
549034394

Actual output:
549034394.0


Fixed submission (verdict: Accepted):
A,B=map(int,input().split())
K=int((A+B)/2)
if (A+B)%2==0:
    print(K)
else: print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a , b = map(int, input().split())
if (a + b)%2 == 0:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

Failing test case input:
44913600 9480486

Expected output:
27197043


Actual output:
27197043.0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if (a + b)%2 == 0:
  print((a+b)
else:
  print("IMPOSSIBLE")
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

x = (a + b)/2

if a != b and abs(a - x) == abs(b - x):
    print(x)

else:
    print("IMPOSSIBLE")

Failing test case input:
649873 20404011

Expected output:
10526942


Actual output:
10526942.0


Fixed submission (verdict: Accepted):

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

x = (a + b)/2

if (a + b)%2 == 0 and abs(a - x) == abs(b - x):
    print(int(x))

else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=(int(x) for x in input().split())
k = abs((a - b)/2)
if k.is_integer() == True:
    print(int(k))
else :
    print('IMPOSSIBLE')

Failing test case input:
011 21039

Expected output:
10525


Actual output:
10514


Fixed submission (verdict: Accepted):
a,b=(int(x) for x in input().split())
k = (a+b)/2
if int(k.is_integer()) == True:
    print(int(k))
else :
    print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int ,input().split())
c = (a + b)/2
if type(c) is int:
  print(c)
else :
  print("IMPOSSIBLE")

Failing test case input:
649873 20404011

Expected output:
10526942


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
a, b = map(int ,input().split())
if (a + b)%2 == 0:
  print(int((a + b)/2))
else :
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
if (a + b) % 2 == 0:
  print((a + b) / 2)
else:
  print('IMPOSSIBLE')

Failing test case input:
101 12903

Expected output:
6502


Actual output:
6502.0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if (a + b) % 2 == 0:
  print(int((a + b) / 2))
else:
  print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
A = int(s.split()[0])
B = int(s.split()[1])

if A == B:
  print(0)
elif (A + B) % 2 == 0:
  print((A+B)/2)
else:
  print('IMPOSSIBLE')

Failing test case input:
13452 75698

Expected output:
44575


Actual output:
44575.0


Fixed submission (verdict: Accepted):
s = input()
A = int(s.split()[0])
B = int(s.split()[1])
 
if (A + B) % 2 == 0:
  print(int((A+B)/2))
else:
  print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if a%2==b%2:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")


Failing test case input:
2773903 1574255

Expected output:
2174079


Actual output:
2174079.0


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if a%2==b%2:
  print (int((a+b)/2))
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
k=(a+b)/2
if int(k)==k:
  print(k)
else:
  print("IMPOSSIBLE")

Failing test case input:
1764893 20404011

Expected output:
11084452


Actual output:
11084452.0


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
k=(a+b)/2
if k.is_integer():
  print(int(k))
else:
  print("IMPOSSIBLE")
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())

if (a+b)%2 != 0:
  print("IMPOSSIBLE")
else:
  print((a+b)/2)


Failing test case input:
1349313191 6197513

Expected output:
677755352


Actual output:
677755352.0


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

if (a+b)%2 == 0:
  print((a+b)
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int, input().split())
if (A+B)%2 == 0:
  K=(A+B)
  print(K)
else:
  print('impossible')

Failing test case input:
804043 1574255

Expected output:
1189149


Actual output:
2378298


Fixed submission (verdict: Accepted):
A,B=map(int, input().split())
if (A+B)%2 == 0:
  print((A+B)
else:
  print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = input().split()
a=int(a)
b=int(b)

if (a+b)%2 ==0:
    print(int(a+b)/2)
else:
    print("IMPOSSIBLE")

Failing test case input:
111 10209

Expected output:
5160


Actual output:
5160.0


Fixed submission (verdict: Accepted):
a,b = input().split()
a=int(a)
b=int(b)

if (a+b)%2 ==0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
if (a + b)%2 == 0 :
    print((a+b)/2)
else:
    print("IMPOSSIBLE") 

Failing test case input:
9903 3311419

Expected output:
1660661


Actual output:
1660661.0


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if (a + b)%2 == 0 :
    print(round((a+b)/2))
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x,y = map(int,input().split())
ans=(x+y)/2
if (y-x) % 2 == 0:
  print(ans)
else:
  print("IMPOSSIBLE")

Failing test case input:
649873 24174675

Expected output:
12412274


Actual output:
12412274.0


Fixed submission (verdict: Accepted):
x,y = map(int,input().split())
ans=(x+y)/2
if (y-x) % 2 == 0:
  print(round(ans))
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
sub = (a+b)/2
if sub % 1 != 0:
  print("IIMPOSSIBLE")
else:
  print(sub)

Failing test case input:
0 34

Expected output:
17


Actual output:
17.0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
sub = (a+b)/2
if sub % 1 != 0:
  print("IMPOSSIBLE")
else:
  print(int(sub))

Problem: p02957
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b=map(int,input().split())
if abs(a-b)==1:
    print("IMPOSSIBLE")
else:
    print(int((a+b)/2))

Failing test case input:
899758294 99824435

Expected output:
IMPOSSIBLE


Actual output:
499791364


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if abs(a-b)%2==1:
    print("IMPOSSIBLE")
else:
    print(int((a+b)/2))
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
K = A + B
if K % 2 == 0:
    print(K)
else:
    print("IMPOSSIBLE")

Failing test case input:
707160285 9274641

Expected output:
358217463


Actual output:
716434926


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
K = A + B
if K % 2 == 0:
    print(K
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b = map(int, input().split())
if((a+b)%2==0):
  print(int((a+b)/2))
else:
  print("IMPOSSIBE")

Failing test case input:
899758294 99824435

Expected output:
IMPOSSIBLE


Actual output:
IMPOSSIBE


Fixed submission (verdict: Accepted):
a,b = map(int, input().split())
if((a+b)%2==0):
  print(int((a+b)/2))
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
c = a+b
if c % 2 == 0:
  c = abs(c)
  print(c/2)
else:
  print("IMPOSSIBLE")

Failing test case input:
819805567 9274641

Expected output:
414540104


Actual output:
414540104.0


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
c = a+b
if c % 2 == 0:
  print(int(c/2))
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())

if A%2 != B%2:
  print("IMPOSSIBLE")
else:
  print((A+B)/2)

Failing test case input:
108741947 17746947

Expected output:
63244447


Actual output:
63244447.0


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

if A%2 != B%2:
  print("IMPOSSIBLE")
else:
  print(int((A+B)/2))

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


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

if (A+B)%2 == 0:
  print((A+B)/2)
else:
  print("IMPOSSIBLE")

Failing test case input:
50 2

Expected output:
26


Actual output:
26.0


Fixed submission (verdict: Accepted):

 
A,B = map(int, input().split())
 
if (A+B)%2 == 0:
  print(int((A+B)/2))
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b = map(int, input().split())


if (a + b) % 2 == 0:
    k = (a + b) / 2
    print(k)
else:
    print("IMPOSSIBLE")

Failing test case input:
111 12903

Expected output:
6507


Actual output:
6507.0


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


if (a + b) % 2 == 0:
    k = (a + b) / 2
    print(int(k))
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
K = A + B
if K % 2 == 0 and K > 2000000000:
  print(K / 2)
else:
  print("IMPOSSIBLE")


Failing test case input:
1258 96120

Expected output:
48689


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
K = A + B
if K % 2 == 0:
  print(K 
else:
  print("IMPOSSIBLE")
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())

if (a+b)%2==0:
    print((a+b)/2)
else:
    print("IMPOSSIBLE")


Failing test case input:
4 42

Expected output:
23


Actual output:
23.0


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

if (a+b)%2==0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")

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

if (a+b%2) == 0:
  print(int(a+b/2))
else:
  print("IMPOSSIBLE")

Failing test case input:
1258 96120

Expected output:
48689


Actual output:
IMPOSSIBLE


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

if ((a+b)%2) == 0:
  print(int((a+b)/2))
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = input().split()
A = int(num[0])
B = int(num[1])
if (A+B)%2 == 0:
    print((A+B)/2)
else:
    print("IMPOSSIBLE")

Failing test case input:
819805567 6544429

Expected output:
413174998


Actual output:
413174998.0


Fixed submission (verdict: Accepted):
num = list(map(int, input().split()))
A = num[0]
B = num[1]
if (A+B)%2 == 0:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

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

a, b = map(int, input().split())
k = (a + b) / 2
l = (a + b) % 2
if l == 0:
    print(k)
else:
    print("IMPOSSIBLE")

Failing test case input:
1258 32696

Expected output:
16977


Actual output:
16977.0


Fixed submission (verdict: Accepted):


a_b_list = list(map(int,input().split()))
a = a_b_list[0]
b = a_b_list[1]

k = (a + b) / 2
l = (a + b) % 2

if l == 0:
  print(int(k))
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int,input().split())
x = a + b
if x % 2 == 0:
    print(x / 2)
else:
    print('IMPOSSIBLE')

Failing test case input:
4 36

Expected output:
20


Actual output:
20.0


Fixed submission (verdict: Accepted):
a, b = map(int,input().split())
x = a + b
if x % 2 == 0:
    print(x 
else:
    print('IMPOSSIBLE')

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

if (a+b)%2==0:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

Failing test case input:
1764893 20404011

Expected output:
11084452


Actual output:
11084452.0


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
 
if (a+b)%2==0:
  print(int((a+b)/2))
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if (a+b)%2==1:
    print("IMPOSSIBLE")
else:
    print((a+b)/2)
   

Failing test case input:
351241 1574255

Expected output:
962748


Actual output:
962748.0


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if (a+b)%2==1:
    print("IMPOSSIBLE")
else:
    print(int((a+b)/2))
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())

K = (A + B) / 2

if K.is_integer():
  print(K)
else:
  print("IMPOSSIBLE")

Failing test case input:
146724 1911600

Expected output:
1029162


Actual output:
1029162.0


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
     
if (A + B) % 2 == 0:
  print((A + B) 
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
if a % 2 != b % 2:
	print('IMPOSSIBLE')
else:
	print((a + b) / 2)

Failing test case input:
146724 1911600

Expected output:
1029162


Actual output:
1029162.0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if a % 2 != b % 2:
	print('IMPOSSIBLE')
else:
	print((a + b)

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

if ((a - b) / 2 ) % 2 == 0:
    print((a - b) / 2 )
else:
    print("IMPOSSIBLE")

Failing test case input:
2563528379 13118121

Expected output:
1288323250


Actual output:
IMPOSSIBLE


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

if (a - b) % 2 == 0:
    print((a + b) 
else:
    print("IMPOSSIBLE")

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

c = a + b

if c % 2 == 0:
  print(c)
else:
  print('IMPOSSIBLE')
  

Failing test case input:
-2 24

Expected output:
11


Actual output:
22


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

if (a + b) % 2 == 0:
    print((a + b) 
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
ans = (a+b)/2

if ans == int(ans):
  print(ans)
else:
  print('IMPOSSIBLE')

Failing test case input:
4 36

Expected output:
20


Actual output:
20.0


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
ans = (a+b)/2
 
if ans == int(ans):
  print(int(ans))
else:
  print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inputs = input().split()
a = int(inputs[0])
b = int(inputs[1])
if (a - b) % 2 == 0:
  print( (a + b) / 2 )
else:
  print('IMPOSSIBLE')


Failing test case input:
7456 873182

Expected output:
440319


Actual output:
440319.0


Fixed submission (verdict: Accepted):
inputs = input().split()
a = int(inputs[0])
b = int(inputs[1])
if (a - b) % 2 == 0:
  print( int((a + b) / 2 ))
else:
  print('IMPOSSIBLE')

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int,input().split())
if (a+b)%2 == 0:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

Failing test case input:
819805567 8560445

Expected output:
414183006


Actual output:
414183006.0


Fixed submission (verdict: Accepted):
a, b = map(int,input().split())
if (a+b)%2 == 0:
  print((a+b)
else:
  print("IMPOSSIBLE")
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())

if (b-a) % 2 == 0:
    print(int((max(a,b)-min(a,b))/2))
else:
    print("IMPOSSIBLE")



Failing test case input:
101 12903

Expected output:
6502


Actual output:
6401


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

if (b-a) % 2 == 0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
if(a==b or (a+b)%2==0):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Failing test case input:
969473 24174675

Expected output:
12572074


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if(a==b or (a+b)%2==0):
    print((a+b)
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int,input().split())

if (A+B) % 2 == 0:
  print ((A+B)/2)
else :
  print("IMPOSSIBLE")




Failing test case input:
0 54

Expected output:
27


Actual output:
27.0


Fixed submission (verdict: Accepted):
A, B = map(int,input().split())
 
if (A+B) % 2 == 0:
  print(int((A+B)/2))
else :
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num=input().split()
A=int(num[0])
B=int(num[1])
if A==B:
    print(0)
elif (A+B)%2==0:
    print((A+B)/2)
else:
    print("IMPOSSIBLE")

Failing test case input:
44913600 9480486

Expected output:
27197043


Actual output:
27197043.0


Fixed submission (verdict: Accepted):
num=input().split()
A=int(num[0])
B=int(num[1])
if A==B:
    print(0)
elif (A+B)%2==0:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B= map(int, input().split())
diff_ba = B-A
if diff_ba % 2 == 0:
  print(A + diff_ba)
else:
  print("IMPOSSIBLE")

Failing test case input:
101 12903

Expected output:
6502


Actual output:
12903


Fixed submission (verdict: Accepted):
A, B= map(int, input().split())
diff_ba = B-A
if diff_ba % 2 == 0:
  print(A + diff_ba
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
K = A + B
if K % 2 == 0:
  print(K / 2)
else:
  print("IMPOSSIBLE")

Failing test case input:
1349313191 99824435

Expected output:
724568813


Actual output:
724568813.0


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
K = A + B
if K % 2 == 0:
  print(K 
else:
  print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math 
a,b=(int(x) for x in input().split())
print(a)
print(b)
if(a%2 != b%2):
    print("IMPOSSIBLE")
else:
    k=int (a+b)/2
    print(math.floor(k))

Failing test case input:
1258 75698

Expected output:
38478


Actual output:
1258
75698
38478


Fixed submission (verdict: Accepted):
import math 
a,b=(int(x) for x in input().split())
if(a%2 != b%2):
    print("IMPOSSIBLE")
else:
    k=int (a+b)/2
    print(math.floor(k))
Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())

Z = (a+b)%2

if Z==0:
    print(a+b/2)
else:
    print("IMPOSSIBLE")

Failing test case input:
3240969 9769089

Expected output:
6505029


Actual output:
8125513.5


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

 
if (a+b)%2==0:
    print((a+b)
else:
    print("IMPOSSIBLE")

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = [int(n) for n in input().split()]
print((A+B)/2 if (A+B)/2%2==0 else "IMPOSSIBLE")

Failing test case input:
0 34

Expected output:
17


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
A, B = [int(n) for n in input().split()]
print('IMPOSSIBLE' if (A+B)%2 else (A+B)

Problem: p02957
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
if (a + b) % 2 == 0 :
  print((a + b) / 2)
else :
  print("IMPOSSIBLE")


Failing test case input:
108741947 17746947

Expected output:
63244447


Actual output:
63244447.0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if (a + b) % 2 == 0 :
  print((a + b) 
else :
  print("IMPOSSIBLE")
Problem: p02748
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):


a, b, m = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
res = A[0] + B[0]
for j in range(m):
    x, y, c = map(int, input().split())
    summ = A[x-1] + B[y-1] - c
    if summ < res:
        res = summ

print(res)

Failing test case input:
2 4 0
2 1
1 5
1 2 2

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):


a, b, m = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
res = min(A) + min(B)
for j in range(m):
    x, y, c = map(int, input().split())
    summ = A[x-1] + B[y-1] - c
    if summ < res:
        res = summ

print(res)

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
min = A[0]+B[0]
for i in range(M):
  x,y,c = [int(i) for i in input().split()]
  buf = A[x-1]+B[y-1]-c
  print(A[x-1],B[y-1],c)
  if buf<min:
    min = buf
print(min)

Failing test case input:
2 3 1
0 4
3 6 3
1 2 0

Expected output:
3


Actual output:
0 6 0
3


Fixed submission (verdict: Accepted):
A,B,M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
min = min(A)+min(B)
for i in range(M):
  x,y,c = [int(i) for i in input().split()]
  buf = A[x-1]+B[y-1]-c
  if buf<min:
    min = buf
print(min)

Problem: p02748
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xyc = [list(map(int, input().split())) for _ in range(M)]

cost = []
cost.append(min(a) + min(b))
for x, y, c in xyc:
    tmp = a[x - 1] + b[y - 1] - c
    cost.append(tmp)
print(cost)


Failing test case input:
2 2 1
2 1
3 8
2 2 2

Expected output:
4


Actual output:
[4, 7]


Fixed submission (verdict: Accepted):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xyc = [list(map(int, input().split())) for _ in range(M)]

cost = []
cost.append(min(a) + min(b))
for x, y, c in xyc:
    tmp = a[x - 1] + b[y - 1] - c
    cost.append(tmp)
print(min(cost))

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,M=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
xyc=[list(map(int,input().split())) for i in range(M)]

noti=min(a)+min(b)
ans=0
c=0

for i in range(M):
    c=a[xyc[i][0]-1] + b[xyc[i][1]-1] -xyc[i][2]
    ans=min(noti,c)
print(ans)

Failing test case input:
2 7 0
-2 5
13 10 0
1 4 2

Expected output:
-2


Actual output:
0


Fixed submission (verdict: Accepted):
A,B,M=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
xyc=[list(map(int,input().split())) for i in range(M)]

noti=min(a)+min(b)
ans=noti
c=0

for i in range(M):
    c=a[xyc[i][0]-1] + b[xyc[i][1]-1] -xyc[i][2]
    ans=min(ans,c)
print(ans)
Problem: p02748
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ab = [a+b for a, b in zip(a, b)]
ans = []
for i in ab:
    ans.append(i)

for i in range(m):
    x, y, c = map(int, input().split())
    ans.append(a[x-1]+b[y-1]-c)

print(min(ans))

Failing test case input:
2 4 0
1 6
8 3 0
1 2 1

Expected output:
1


Actual output:
9


Fixed submission (verdict: Accepted):
a, b, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
aa = min(a)
bb = min(b)
aabb = aa+bb
ab = [a+b for a, b in zip(a, b)]
ans = []
for i in ab:
    ans.append(i)

for i in range(m):
    x, y, c = map(int, input().split())
    ans.append(a[x-1]+b[y-1]-c)

ans.append(aabb)
print(min(ans))

Problem: p02748
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

a_n, b_n, m = map(int, input().split())
a = input().split()
b = input().split()
x = [input().split() for i in range(m)]


min_price = 200000
for p in x:
   tmp_price = int(a[int(p[0])-1]) + int(b[int(p[1])-1]) - int(p[2])
   if tmp_price < min_price:
       min_price = tmp_price
print(min_price)       

Failing test case input:
2 4 0
1 6
3 9 0
1 2 1

Expected output:
1


Actual output:
200000


Fixed submission (verdict: Accepted):

a_n, b_n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = [input().split() for i in range(m)]


min_price = min(a) + min(b)
for p in x:
   tmp_price = int(a[int(p[0])-1]) + int(b[int(p[1])-1]) - int(p[2])
   if tmp_price < min_price:
       min_price = tmp_price
print(min_price)

Problem: p02748
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort()
disc = []
for i in range(M):
  disc.append(list(map(int,input().split())))
ans = a[0] + b[0]
for i in range(M):
  ans = min(a[disc[i][0]-1] + b[disc[i][1]-1] - disc[i][2], ans)     
    
print(a,b,ans)

Failing test case input:
2 4 0
0 6
3 6 0
0 1 1

Expected output:
0


Actual output:
[0, 6] [0, 3, 6] 0


Fixed submission (verdict: Accepted):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
disc = []
for i in range(M):
  disc.append(list(map(int,input().split())))
ans = min(a) + min(b)
for i in range(M):
  ans = min(a[disc[i][0]-1] + b[disc[i][1]-1] - disc[i][2], ans)     
    
print(ans)

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,m=map(int,input().split())
al=list(map(int,input().split()))
bl=list(map(int,input().split()))
x=min(al)+min(bl)
for i in range(m):
  x,y,c=map(int,input().split())
  t=al[x-1]+bl[y-1]-c
  x=min(x,t)
print(x)

Failing test case input:
2 2 1
5 2
3 8
2 2 0

Expected output:
5


Actual output:
2


Fixed submission (verdict: Accepted):
a,b,m=map(int,input().split())
al=list(map(int,input().split()))
bl=list(map(int,input().split()))
z=min(al)+min(bl)
for i in range(m):
  x,y,c=map(int,input().split())
  t=al[x-1]+bl[y-1]-c
  z=min(z,t)
print(z)
Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
z = [list(map(int, input().split())) for _ in range(M)]

C = min(A, B)
mem = []
for i, j in zip(a, b):
    mem.append(i + j)

for x, y, c in z:
    mem.append(a[x - 1] + b[y - 1] - c)

print(min(mem))


Failing test case input:
2 4 0
1 6
3 8 0
0 1 1

Expected output:
1


Actual output:
4


Fixed submission (verdict: Accepted):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
L = [[int(x) for x in input().split()] for _ in range(M)]

reg = min(a) + min(b)
for x, y, c in L:
    tmp = a[x-1] + b[y-1] - c
    reg = min(reg, tmp)
print(reg)

Problem: p02748
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A, B, M = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
ans = int(1e18)
for i in range(M):
    x, y, c = map(int, input().split(' '))
    ans = min(ans, a[x - 1] + b[y - 1] - c)
print(ans)

Failing test case input:
2 10 0
-3 0
11 10 -2
0 2 2

Expected output:
-5


Actual output:
1000000000000000000


Fixed submission (verdict: Accepted):
A, B, M = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
ans = min(a) + min(b)
for i in range(M):
    x, y, c = map(int, input().split(' '))
    ans = min(ans, a[x - 1] + b[y - 1] - c)
print(ans)

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, M = map(int, input().split())
ref = list(map(int, input().split()))
mic = list(map(int, input().split()))
coupons = [ list(map(int, input().split())) for i in range(M)]
ans = min(ref) + min(mic)

for i in coupons:
  print(i)
  price = ref[i[0]-1] + mic[i[1]-1] - i[2]
  if price < ans:
    ans = price

print(ans)


Failing test case input:
2 3 1
3 4
3 6 3
0 2 0

Expected output:
6


Actual output:
[0, 2, 0]
6


Fixed submission (verdict: Accepted):
A, B, M = map(int, input().split())
ref = list(map(int, input().split()))
mic = list(map(int, input().split()))
coupons = [ list(map(int, input().split())) for i in range(M)]
ans = min(ref) + min(mic)

for i in coupons:
  price = ref[i[0]-1] + mic[i[1]-1] - i[2]
  if price < ans:
    ans = price

print(ans)

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

min = min(a) + min(b)

for i in range(M):
  x, y, c = list(map(int, input().split()))
  tmp = a[x - 1] + b[y - 1] + c
  if min > tmp:
    min = tmp

print(min)

Failing test case input:
1 1 2
17
10
1 0 0
1 1 4

Expected output:
23


Actual output:
27


Fixed submission (verdict: Accepted):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
min = min(a) + min(b)

for i in range(M):
  x, y, c = list(map(int, input().split()))
  tmp = a[x - 1] + b[y - 1] - c
  if min > tmp:
    min = tmp

print(min)
Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

A, B, M = map(int, input().split())

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

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

z = [list(map(int, input().split())) for _ in range(M)]
num1 = a[0] + b[0]
for i in range(M):
    
    x, y, c = z[i]
    
    num = a[x - 1] + b[y - 1] - c
    
    if num < num1:
        num1 = num
print(num1)

Failing test case input:
2 4 0
-2 6
8 4 0
1 4 2

Expected output:
-2


Actual output:
6


Fixed submission (verdict: Accepted):

A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a1 = sorted(a)
b1 = sorted(b)
z = [list(map(int, input().split())) for _ in range(M)]

num1 = a1[0] + b1[0]

for i in range(M):
    x, y, c = z[i]
    num = a[x - 1] + b[y - 1] - c
    if num < num1:
        num1 = num
print(num1)

Problem: p02748
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

vals = []
for _ in range(M):
    i, j, v = map(int, input().split())
    print(i, j, v)
    vals.append( a[i - 1] + b[j - 1] - v)

vals.append(min(a) + min(b))
print(min(vals))

Failing test case input:
2 3 1
2 4
3 6 3
1 2 0

Expected output:
5


Actual output:
1 2 0
5


Fixed submission (verdict: Accepted):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

vals = []
for _ in range(M):
    i, j, v = map(int, input().split())
    vals.append( a[i - 1] + b[j - 1] - v)

vals.append(min(a) + min(b))
print(min(vals))

Problem: p02748
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
lists = [list(map(int,input().split())) for i in range(m)]
a.sort()
b.sort()
Min = min(a) + min(b)
for x,y,c in lists:
    Min = min(Min,a[x-1] + b[y-1] - c)
print(Min)



Failing test case input:
2 3 1
3 4
3 6 3
1 2 1

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
a,b,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
lists = [list(map(int,input().split())) for i in range(m)]
Min = min(a) + min(b)
for x,y,c in lists:
    Min = min(Min,a[x-1] + b[y-1] - c)
print(Min)

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
ans = a[0] + b[0]
for i in range(m):
    x,y,c = map(int,input().split())
    x -= 1
    y -= 1
    ans = min(ans,a[x] + b[y] -c)
print(ans)
    
    


Failing test case input:
2 3 1
3 3
3 6 3
1 2 1

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
a,b,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = 10**8
for i in range(m):
    x,y,c = map(int,input().split())
    x-= 1
    y -=1
    ans = min(ans,a[x]+ b[y]-c)
a.sort()
b.sort()
ans = min(ans,a[0] + b[0])
print(ans)
Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,M = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]
b = [int(s) for s in input().split()]

min_cost = 10 ** 6

for i in range(M):
  x,y,c = [int(s) for s in input().split()]
  if min_cost > a[x-1] + b[y-1] - c:
    min_cost = a[x-1] + b[y-1] - c
    
print(min_cost)

Failing test case input:
2 4 0
0 6
3 6 0
0 1 1

Expected output:
0


Actual output:
1000000


Fixed submission (verdict: Accepted):
A,B,M = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]
b = [int(s) for s in input().split()]

min_cost = 10 ** 6

for i in range(M):
  x,y,c = [int(s) for s in input().split()]
  if min_cost > a[x-1] + b[y-1] - c:
    min_cost = a[x-1] + b[y-1] - c
    
    
min_cost2 = min(a) + min(b)
print(min_cost) if min_cost < min_cost2 else print(min_cost2)

Problem: p02748
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b,m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = a[0]+b[0]
for i in range(m):
    x,y,c = list(map(int, input().split()))
    if a[x-1]+b[y-1]-c<ans: ans = a[x-1]+b[y-1]-c
print(ans)

Failing test case input:
5 10 0
-6 0
12 10 -2
-1 2 1

Expected output:
-8


Actual output:
6


Fixed submission (verdict: Accepted):
a,b,m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = min(a)+min(b)
for i in range(m):
    x,y,c = list(map(int, input().split()))
    if a[x-1]+b[y-1]-c<ans: ans = a[x-1]+b[y-1]-c
print(ans)

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = float("inf")
for i in range(m):
  x,y,c = map(int, input().split())
  ans = min(ans,a[x-1]+b[y-1]-c)
print(ans)

Failing test case input:
2 4 0
1 6
3 8 0
1 2 1

Expected output:
1


Actual output:
inf


Fixed submission (verdict: Accepted):
a,b,m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = min(a)+min(b)
for i in range(m):
  x,y,c = map(int, input().split())
  ans = min(ans,a[x-1]+b[y-1]-c)
print(ans)

Problem: p02748
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort()
disc = []
for i in range(M):
  disc.append(list(map(int,input().split())))
ans = a[0] + b[0]
for i in range(M):
  ans = min(a[disc[i][0]-1] + b[disc[i][1]-1] - disc[i][2], ans)     
    
print(ans)

Failing test case input:
2 3 1
3 3
3 6 3
1 2 1

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
disc = []
for i in range(M):
  disc.append(list(map(int,input().split())))
ans = min(a) + min(b)
for i in range(M):
  ans = min(a[disc[i][0]-1] + b[disc[i][1]-1] - disc[i][2], ans)     
    
print(ans)
Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
kingaku=[]
for i in range(M):
    x_input, y_input, c_input = map(int, input().split())
    kingaku.append(a[x_input-1]+b[y_input-1]+c_input)
kingaku.append(min(a)+min(b))

print(min(kingaku))

Failing test case input:
1 1 2
10
10
1 1 5
1 1 10

Expected output:
10

Actual output:
20


Fixed submission (verdict: Accepted):

A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
kingaku=[]
for i in range(M):
    x_input, y_input, c_input = map(int, input().split())
    kingaku.append(a[x_input-1]+b[y_input-1]-c_input)
kingaku.append(min(a)+min(b))

print(min(kingaku))

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,m=map(int,input().split())
*a,=map(int,input().split())
*b,=map(int,input().split())
mi=10**9
for i in range(m):
    x,y,c=map(int,input().split())
    if len(a)<=x and len(b)<=y:
        res=a[x-1]+b[y-1]-c
        mi=min(mi,res)
l=min(a)+min(b)
print(min(mi,l))

Failing test case input:
2 3 1
3 3
3 3 3
1 2 1

Expected output:
5

Actual output:
6


Fixed submission (verdict: Accepted):
a,b,m=map(int,input().split())
*a,=map(int,input().split())
*b,=map(int,input().split())
ans=10**9
for i in range(m):
    x,y,c=map(int,input().split())
    if len(a)>=x and len(b)>=y:
        res=a[x-1]+b[y-1]-c
        ans=min(ans,res)
l=min(a)+min(b)
print(min(ans,l))

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
aa = a.sort()
bb = b.sort()
lis = []
mi = 10**12
for i in range(m):
  x, y, c = map(int, input().split())
  s = a[x-1]+b[y-1]-c
  mi = min(s, mi)
mii = a[0]+b[0]
ans = min(mii,mi)
print(ans)

Failing test case input:
2 3 1
3 4
3 6 3
1 2 1

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
a, b, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
aa = sorted(a)
bb = sorted(b)
lis = []
mi = 10**12
for i in range(m):
  x, y, c = map(int, input().split())
  s = a[x-1]+b[y-1]-c
  mi = min(s, mi)
mii = aa[0]+bb[0]
ans = min(mii,mi)
print(ans)

Problem: p02748
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,M = map(int,input().split())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
S = P
T = Q
S.sort()
T.sort()
minimum = (S[0]+T[0])
for i in range(M):
    x,y,c = map(int,input().split())
    S = P[x-1]+Q[y-1]-c
    if S<minimum:
        minimum = S
print(minimum)

Failing test case input:
2 3 1
3 3
3 6 3
1 2 1

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
A,B,M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
K = min(a)+min(b)
X = 10**9
for i in range(M):
    x,y,c = map(int,input().split())
    S = a[x-1]+b[y-1]-c
    if S<X:
        X = S
if X<K:
    print(X)
else:
    print(K)