ZhenlongDai/ACPR huggingface dataset:
Problem: p03102
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A=[]
for i in range(N):
    A.append(list(map(int,input().split())))


cnt =0
for a in A:
    c = 0
    for j in range(len(a)):
        c += a[j]*B[j]
    if c-abs(C) > 0:
        cnt += 1

print(cnt)

Failing test case input:
3 3 1
101 -100 -1
-1 100 101
100 100 100
-100 100 100

Expected output:
1


Actual output:
0


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


cnt =0
for a in A:
    c = 0
    for j in range(len(a)):
        c += a[j]*B[j]
    if c+C > 0:
        cnt += 1

print(cnt)

Problem: p03102
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,C=map(int, input().split())
B=list(map(int, input().split()))
A=[]
ans=0
a=0
for i in range(N):
    A.append([int(j) for j in input().split()])
for i in range(N):
    for j in range(M):
         a+=A[i][j]*B[j]
    if a+C>0:
        ans+=1
print(ans)

Failing test case input:
3 3 1
101 -100 -1
0 100 101
110 100 111
-100 100 100

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N,M,C=map(int, input().split())
B=list(map(int, input().split()))
A=[]
ans=0
a=0
for i in range(N):
    A.append([int(j) for j in input().split()])
for i in range(N):
    for j in range(M):
         a+=A[i][j]*B[j]
    if a+C>0:
        ans+=1
        a=0
    else:
        a=0
print(ans)

Problem: p03102
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,C=map(int, input().split())
B=list(map(int, input().split()))

count=0
for i in range(N):
  A = list(map(int, input().split()))
  sum=0
  for j in range(M):
    sum+=B[j]*A[j]
    if sum+C>0:
      count+=1

print(count)

Failing test case input:
3 3 0
100 -100 1
0 100 100
110 100 100
-100 100 100

Expected output:
1


Actual output:
3


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

count=0
for i in range(N):
  A = list(map(int, input().split()))
  sum=0
  for j in range(M):
    sum+=B[j]*A[j]
  if sum+C>0:
    count+=1

print(count)

Problem: p03102
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(n)]

ans = 0
for i in range(n):
  s = sum([a[i][j]*b[j] for j in range(m)])
  if s+c > 0:
    print(i)
    ans += 1
print(ans)

Failing test case input:
3 3 1
101 -100 0
-1 100 111
100 100 100
-100 100 100

Expected output:
1


Actual output:
1
1


Fixed submission (verdict: Accepted):
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(n)]

ans = 0
for i in range(n):
  s = sum([a[i][j]*b[j] for j in range(m)])
  if s+c > 0:
    ans += 1
print(ans)
Problem: p03102
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m, c = map(int, input().split())
b_lists = list(map(int, input().split()))
a_lists = []
for _ in range(n):
    tmp = list(map(int, input().split()))
    a_lists.append(tmp)

cond = c
ans = 0
for i in a_lists:
    for j in range(m):
        cond = c
        cond += i[j]*b_lists[j]
    if cond > 0:
        ans += 1

print(ans)

Failing test case input:
3 3 1
101 -100 0
-1 100 101
100 100 100
-100 100 100

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n, m, c = map(int, input().split())
b_lists = list(map(int, input().split()))
a_lists = []
for _ in range(n):
    tmp = list(map(int, input().split()))
    a_lists.append(tmp)

ans = 0
for i in a_lists:
    cond = c
    for j in range(m):
        cond += i[j]*b_lists[j]
    if cond > 0:
        ans += 1

print(ans)

Problem: p03102
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m , c = map(int, input().split())
b_li = list(map(int, input().split()))
ans = 0
for i in range(n):
    a_li = list(map(int, input().split()))
    if (0 < a * b + c for a, b in zip(a_li, b_li)):
        ans += 1
print(ans)


Failing test case input:
2 2 -4
-2 1
100 41
100 5
-6 0
-6 -2
18 -13

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
n, m , c = map(int, input().split())
b_li = list(map(int, input().split()))
ans = 0
for i in range(n):
    a_li = list(map(int, input().split()))
    if sum(a * b for a, b in zip(a_li, b_li)) + c > 0:
        ans += 1
print(ans)

Problem: p03102
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,C=map(int, input().split())
B=list(map(int, input().split()))
A=[]
ans=0
a=0
for i in range(N):
    A.append([int(j) for j in input().split()])
for i in range(N):
    for j in range(M):
         a+=A[i][j]*B[j]
    if a+C==0:
        ans+=1
print(ans)

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

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N,M,C=map(int, input().split())
B=list(map(int, input().split()))
A=[]
ans=0
a=0
for i in range(N):
    A.append([int(j) for j in input().split()])
for i in range(N):
    for j in range(M):
         a+=A[i][j]*B[j]
    if a+C>0:
        ans+=1
        a=0
    else:
        a=0
print(ans)

Problem: p03102
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M, C = input().split(' ')
N = int(N)
M = int(M)
C = int(C)
B = []
B = input().split(' ')
B = [int(i) for i in B]
A = []
R = 0
for i in range(N):
  A = input().split(' ')
  A = [int(i) for i in A]
  combine = [x * y for (x, y) in zip(A, B)]
  print(sum(combine) + C)
  if sum(combine) + C > 0:
    R += 1
print(R)

Failing test case input:
2 3 -1
111 -173 0
-1 000 101
100 100 100
-100 100 100

Expected output:
0


Actual output:
-112
-6201
0


Fixed submission (verdict: Accepted):
N, M, C = input().split(' ')
N = int(N)
M = int(M)
C = int(C)
B = []
B = input().split(' ')
B = [int(i) for i in B]
A = []
R = 0
for i in range(N):
  A = input().split(' ')
  A = [int(i) for i in A]
  combine = [x * y for (x, y) in zip(A, B)]
  if sum(combine) + C > 0:
    R += 1
print(R)
Problem: p03102
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


N,M,C=map(int, input().split())

B=list(map(int, input().split()))
count=total=0

for j in range(N):
  A=list(map(int, input().split()))
  for k in range(M):
    total=total+(A[k]*B[k])
  else:
    if total+C>0:
      count+=1
      total=0

print(count)

Failing test case input:
3 3 0
100 -100 0
0 100 101
100 000 100
-100 100 100

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):


N, M, C= map(int, input().split())
B=list(map(int, input().split()))
count=0
for i in range(N):
    A=[]
    total=0
    A=list(map(int, input().split()))
    for j in range(M):
        total=total+(A[j]*B[j])
    else:
        if total+C>0:
            count+=1

print(count)
Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
kuku = [1, 2, 3, 4, 5, 6, 7, 8, 9]
kuku1 = [a * b for a in kuku for b in kuku]
if N in kuku:
  print("Yes")
else:
  print("No")

Failing test case input:
00010

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
kuku = [1, 2, 3, 4, 5, 6, 7, 8, 9]
kuku1 = [a * b for a in kuku for b in kuku]
if N in kuku1:
  print("Yes")
else:
  print("No")

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
for i in range(1,10):
  if a%i==0:
    print('Yes')
    break
else:
  print('No')

Failing test case input:
1155

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a=int(input())
for i in range(1,10):
  if a%i==0:
    if a
      print('Yes')
      break
else:
  print('No')

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
dic={}

for i in range(9):
    for j in range(9):
        if dic.get(i*j,None)==None:
            dic[i*j]=1
        else:
            dic[i*j]+=1

N = int(input())

if dic.get(N,None)==None:
    print("No")
else:
    print("Yes")

Failing test case input:
00000

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
dic={}

for i in range(1,10):
    for j in range(1,10):
        if dic.get(i*j,None)==None:
            dic[i*j]=1
        else:
            dic[i*j]+=1

N = int(input())

if dic.get(N,None)==None:
    print("No")
else:
    print("Yes")

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

able = False
for i in range(1, 10):
    for j in range(1, 10):
        if N == i * j:
            able = True
            break
    if able == True:
        break

if able == True:
    print('YES')
else:
    print('No')

Failing test case input:
00010

Expected output:
Yes


Actual output:
YES


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

able = False
for i in range(1, 10):
    for j in range(1, 10):
        if N == i * j:
            able = True
            break
    if able == True:
        break

if able == True:
    print('Yes')
else:
    print('No')

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
for a in range(1,10):
    for b in range(1,10):
        if N==a*b:
            print("Yes")
        else:
            print("No")

Failing test case input:
00000

Expected output:
No


Actual output:
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
N=int(input())
for a in range(1,10):
    for b in range(1,10):
        if a*b==N:
            print("Yes")
            exit()
print("No")
Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
Flag = False
for x in range(1,10):
    for y in range(x,10):
        print("x"+str(x)+":y"+str(y))
        if x * y == num:
            Flag = True
            break
    if Flag == True:
        break

if Flag:
    print("Yes")
else:
    print("No")


Failing test case input:
1961

Expected output:
No


Actual output:
x1:y1
x1:y2
x1:y3
x1:y4
x1:y5
x1:y6
x1:y7
x1:y8
x1:y9
x2:y2
x2:y3
x2:y4
x2:y5
x2:y6
x2:y7
x2:y8
x2:y9
x3:y3
x3:y4
x3:y5
x3:y6
x3:y7
x3:y8
x3:y9
x4:y4
x4:y5
x4:y6
x4:y7
x4:y8
x4:y9
x5:y5
x5:y6
x5:y7
x5:y8
x5:y9
x6:y6
x6:y7
x6:y8
x6:y9
x7:y7
x7:y8
x7:y9
x8:y8
x8:y9
x9:y9
No


Fixed submission (verdict: Accepted):
num = int(input())
Flag = False
for x in range(1,10):
  for y in range(x,10):
    if x * y == num:
      Flag = True
      break
    if Flag == True:
      break

if Flag:
  print("Yes")
else:
  print("No")

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()

ran = list(range(1,10))
product = [x*y for x in ran for y in ran]
print("Yes") if n in product else print("No")

Failing test case input:
00010

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
if not isinstance(n, int):
    print("No")
else:
    ran = list(range(1,10))
    product = [x*y for x in ran for y in ran]
    print("Yes") if n in product else print("No")

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        print(i,j)
        if i * j == n:
            print('Yes')
            exit()
else:print('No')

Failing test case input:
00001

Expected output:
Yes


Actual output:
1 1
Yes


Fixed submission (verdict: Accepted):
n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            exit()
else:print('No')

Problem: p02880
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
n=int(input())
for i in range(1,10):
    if n%i==0:
        print("Yes")
        sys.exit()
print("No")

Failing test case input:
7362

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys
n=int(input())
for i in range(1,10):
    if n%i==0 and 1<=n
        print("Yes")
        sys.exit()
print("No")

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

ln = []

for i in range(9):
  for j in range(9):
    ln.append(i*j)
    
print("Yes" if n in ln else "No")

Failing test case input:
00000

Expected output:
No


Actual output:
Yes


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

ln = []

for i in range(1,10):
  for j in range(1,10):
    ln.append(i*j)
    
print("Yes" if n in ln else "No")
Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
printed = False
for i in range(1, 10):
    for j in range(1, 10):
        if N == i * j:
            print('Yes')
            printed = True
            break

if not printed:
    print('No')

Failing test case input:
00001

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
printed = False
try:
    for i in range(1, 10):
        for j in range(1, 10):
            if N == i * j:
                print('Yes')
                printed = True
                raise Exception
except Exception:
    pass

if not printed:
    print('No')

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
avail_numbers = [(i + 1) * (j + 1) for i, j in zip(range(9), range(9))]

if int(input()) in avail_numbers:
  print("Yes")
else:
  print("No")


Failing test case input:
00010

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
from itertools import product as prod
avail_numbers = [(i + 1) * (j + 1) for i, j in prod(range(9), range(9))]

if int(input()) in avail_numbers:
  print("Yes")
else:
  print("No")

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())

for i in range(2,10):
  for j in range(2,10):
    if i*j==n:
      print('Yes')
      exit()

print('No')


Failing test case input:
00001

Expected output:
Yes


Actual output:
No


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

for i in range(1,10):
  for j in range(1,10):
    if i*j==n:
      print('Yes')
      exit()

print('No')

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools


def read():
    N = int(input())

    return N,


def solve(N, ):
    for i in range(9):
        a = i + 1

        b = N / a

        if b in [1,2,3,4,5,6,7,8,9]:
            continue
        if a * b == N:
            return "Yes"
        else:
            return "No"


if __name__ == '__main__':
    input = read()
    print(solve(*input))

Failing test case input:
554

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import itertools


def read():
    N = int(input())

    return N,


def solve(N, ):
    for i in range(9):
        a = i + 1
        for j in range(9):
            b = j + 1
            if a*b==N:
                return "Yes"
            else:
                continue
    return "No"


            
            
            
            
            
            
            
            
            
            
            


if __name__ == '__main__':
    input = read()
    print(solve(*input))

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ans = 0
for i in range(2, 10):
  for j in range(2, 10):
    if i * j == n:
      ans += 1
if ans >= 1:
  print("Yes")
else:
  print("No")

Failing test case input:
00001

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
ans = 0
for i in range(1, 10):
  for j in range(1, 10):
    if i * j == n:
      ans += 1
if ans == 0:
  print("No")
else:
  print("Yes")
Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

ans = 'No'
for i in range(1,10):
    for j in range(i+1,10):
        if N == i * j:
            ans = 'Yes'
            
print(ans)

Failing test case input:
00001

Expected output:
Yes


Actual output:
No


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

ans = 'No'
for i in range(1,10):
    for j in range(i,10):
        if N == i * j:
            ans = 'Yes'
            
print(ans)

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

L = set()
for i in range(1,10):
    for j in range(1,10):
        result = i*j
        L.add(result)
print(L)

if n in L:
    print("Yes")
elif n not in L:
    print("No")

Failing test case input:
7362

Expected output:
No


Actual output:
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32, 35, 36, 40, 42, 45, 48, 49, 54, 56, 63, 64, 72, 81}
No


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

L = set()
for i in range(1,10):
    for j in range(1,10):
        result = i*j
        L.add(result)
if n in L:
    print("Yes")
elif n not in L:
    print("No")

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

n=(int(x) for x in input().split())
l=[x*y for x in range(1,10) for y in range(1,10)]
if n not in l:
    print("No")
else :
    print("Yes")

Failing test case input:
00010

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

n=int(input())
l=[x*y for x in range(1,10) for y in range(1,10)]
if n in l:
    print("Yes")
else :
    print("No")

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()

hoge = []
for i in range(1, 10):
    for j in range(1, 10):
        hoge.append(i * j)

if N in hoge:
    print("Yes")
else:
    print("No")

Failing test case input:
00001

Expected output:
Yes


Actual output:
No


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

hoge = []
for i in range(1, 10):
    for j in range(1, 10):
        hoge.append(i * j)

if N in hoge:
    print("Yes")
else:
    print("No")

Problem: p02880
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
for i in range(9):
  for j in range(9):
    if i * j == N:
      print('Yes')
      exit()
print('No')

Failing test case input:
00000

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
for i in range(1, 10):
  for j in range(1, 10):
    if i * j == N:
      print('Yes')
      exit()
print('No')
Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
count = 0
for i in range(A, B):
  i = str(i)
  if i[:2] == i[-2:] :
    count += 1
print(count)

Failing test case input:
11516 30706

Expected output:
192


Actual output:
191


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
count = 0
for i in range(A, B + 1):
  i = str(i)
  if i[:2] == i[::-1][:2] :
    count += 1
print(count)

Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
  n = str(i)
  if n[0] == n[-1] and n[-1] == n[-2]:
    ans += 1
print(ans)

Failing test case input:
15858 19549

Expected output:
36


Actual output:
37


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
  n = str(i)
  if n[0] == n[-1] and n[1] == n[-2]:
    ans += 1
print(ans)

Problem: p03416
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def resolve():
	a, b = map(int, input().split())
	ans = 0
	for i in range(a, b):
		v = str(i)
		d = len(v) 
		if v[:d] == v[d+1:]:
			ans += 1
	print(ans)
resolve()

Failing test case input:
19680 73180

Expected output:
536


Actual output:
0


Fixed submission (verdict: Accepted):
def resolve():
	a, b = map(int, input().split())
	ans = 0
	for i in range(a, b+1):
		v = str(i)
		if v == v[::-1]:
			ans += 1
	print(ans)
resolve()

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

ans = 0
for i in range(a, b+1):
    s = str(i)
    sl = len(s) 
    
    if s[:sl] == s[-sl:]: ans += 1
print(ans)

Failing test case input:
31415 41187

Expected output:
97


Actual output:
9773


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

ans = 0
for i in range(a, b+1):
    s = str(i)
    
    if s == s[::-1]: ans += 1
print(ans)

Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
cnt = 0
for i in range(a,b+1):
	s = str(i)
	if s[:2] == s[-2:]:
		cnt += 1
print (cnt)

Failing test case input:
31415 41187

Expected output:
97


Actual output:
98


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
cnt = 0
for i in range(a,b+1):
	s = str(i)
	d = s[::-1]
	if s == d:
		cnt += 1
print (cnt)

Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def is_palindromic(n):
    if str(n) == str(n)[::-1]:
        True
    else:
        False

A,B = map(int, input().split())
for i in range(A, B):
    if is_palindromic(i):
        print(i)

Failing test case input:
36170 27129

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
def is_palindromic(n):
    if str(n) == str(n)[::-1]:
        return True
    else:
        return False

res = 0
A,B = map(int, input().split())
for i in range(A, B+1):
    if is_palindromic(i):
       res += 1 
print(res)
Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
    i=str(i)
    if i[:2]==i[4:]:
        count+=1
print(count)

Failing test case input:
36382 51391

Expected output:
150


Actual output:
0


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
    i=str(i)
    if i[:3]==i[:1:-1]:
        count+=1
print(count)

Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
ans = 0
for i in range(A,B+1):
    i = str(i)
    if i[0] == i[4]:
        if i[1] == i[3]:
            ans += 1
            print(i)
        else:
            ans += 0
    else:
        ans += 0
print(ans)

Failing test case input:
12729 38240

Expected output:
254


Actual output:
12821
12921
13031
13131
13231
13331
13431
13531
13631
13731
13831
13931
14041
14141
14241
14341
14441
14541
14641
14741
14841
14941
15051
15151
15251
15351
15451
15551
15651
15751
15851
15951
16061
16161
16261
16361
16461
16561
16661
16761
16861
16961
17071
17171
17271
17371
17471
17571
17671
17771
17871
17971
18081
18181
18281
18381
18481
18581
18681
18781
18881
18981
19091
19191
19291
19391
19491
19591
19691
19791
19891
19991
20002
20102
20202
20302
20402
20502
20602
20702
20802
20902
21012
21112
21212
21312
21412
21512
21612
21712
21812
21912
22022
22122
22222
22322
22422
22522
22622
22722
22822
22922
23032
23132
23232
23332
23432
23532
23632
23732
23832
23932
24042
24142
24242
24342
24442
24542
24642
24742
24842
24942
25052
25152
25252
25352
25452
25552
25652
25752
25852
25952
26062
26162
26262
26362
26462
26562
26662
26762
26862
26962
27072
27172
27272
27372
27472
27572
27672
27772
27872
27972
28082
28182
28282
28382
28482
28582
28682
28782
28882
28982
29092
29192
29292
29392
29492
29592
29692
29792
29892
29992
30003
30103
30203
30303
30403
30503
30603
30703
30803
30903
31013
31113
31213
31313
31413
31513
31613
31713
31813
31913
32023
32123
32223
32323
32423
32523
32623
32723
32823
32923
33033
33133
33233
33333
33433
33533
33633
33733
33833
33933
34043
34143
34243
34343
34443
34543
34643
34743
34843
34943
35053
35153
35253
35353
35453
35553
35653
35753
35853
35953
36063
36163
36263
36363
36463
36563
36663
36763
36863
36963
37073
37173
37273
37373
37473
37573
37673
37773
37873
37973
38083
38183
254


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
ans = 0
for i in range(A,B+1):
    i = str(i)
    if i[0] == i[4]:
        if i[1] == i[3]:
            ans += 1
        else:
            ans += 0
    else:
        ans += 0
print(ans)

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

cnt = 0

for i in range(A,B+1):
    
    Str = str(i)
    
    if Str[:2] == Str[3:]:
        cnt += 1
        
print(cnt)

Failing test case input:
15714 19549

Expected output:
38


Actual output:
39


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

cnt = 0

for i in range(A,B+1):
    
    Str = str(i)
    
    if Str[0] == Str[4] and Str[1]==Str[3]:
        cnt += 1
        
print(cnt)
Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,(input().split()))
count = 0
for i in range(a,b+1):
    num_str = str(i)
    if (num_str[0] == num_str[4]) and (num_str[1] == num_str[3]):
        count += 1
print(range(a,b))

Failing test case input:
12729 17376

Expected output:
46


Actual output:
range(12729, 17376)


Fixed submission (verdict: Accepted):
a,b = map(int,(input().split()))
count = 0
for i in range(a,b+1):
    num_str = str(i)

    if (num_str[0] == num_str[4]) and (num_str[1] == num_str[3]):
        count += 1
print(count)
Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input_one = input().split()
i = int(input_one[0])
two = input_one[1]




while  i <= int(two):
    
    i = str(i)
    if i[0] == i[4]:
        if i[1] == i[3]:
            print(int(i))

    i = int(i) + 1

Failing test case input:
44323 83416

Expected output:
391


Actual output:
44344
44444
44544
44644
44744
44844
44944
45054
45154
45254
45354
45454
45554
45654
45754
45854
45954
46064
46164
46264
46364
46464
46564
46664
46764
46864
46964
47074
47174
47274
47374
47474
47574
47674
47774
47874
47974
48084
48184
48284
48384
48484
48584
48684
48784
48884
48984
49094
49194
49294
49394
49494
49594
49694
49794
49894
49994
50005
50105
50205
50305
50405
50505
50605
50705
50805
50905
51015
51115
51215
51315
51415
51515
51615
51715
51815
51915
52025
52125
52225
52325
52425
52525
52625
52725
52825
52925
53035
53135
53235
53335
53435
53535
53635
53735
53835
53935
54045
54145
54245
54345
54445
54545
54645
54745
54845
54945
55055
55155
55255
55355
55455
55555
55655
55755
55855
55955
56065
56165
56265
56365
56465
56565
56665
56765
56865
56965
57075
57175
57275
57375
57475
57575
57675
57775
57875
57975
58085
58185
58285
58385
58485
58585
58685
58785
58885
58985
59095
59195
59295
59395
59495
59595
59695
59795
59895
59995
60006
60106
60206
60306
60406
60506
60606
60706
60806
60906
61016
61116
61216
61316
61416
61516
61616
61716
61816
61916
62026
62126
62226
62326
62426
62526
62626
62726
62826
62926
63036
63136
63236
63336
63436
63536
63636
63736
63836
63936
64046
64146
64246
64346
64446
64546
64646
64746
64846
64946
65056
65156
65256
65356
65456
65556
65656
65756
65856
65956
66066
66166
66266
66366
66466
66566
66666
66766
66866
66966
67076
67176
67276
67376
67476
67576
67676
67776
67876
67976
68086
68186
68286
68386
68486
68586
68686
68786
68886
68986
69096
69196
69296
69396
69496
69596
69696
69796
69896
69996
70007
70107
70207
70307
70407
70507
70607
70707
70807
70907
71017
71117
71217
71317
71417
71517
71617
71717
71817
71917
72027
72127
72227
72327
72427
72527
72627
72727
72827
72927
73037
73137
73237
73337
73437
73537
73637
73737
73837
73937
74047
74147
74247
74347
74447
74547
74647
74747
74847
74947
75057
75157
75257
75357
75457
75557
75657
75757
75857
75957
76067
76167
76267
76367
76467
76567
76667
76767
76867
76967
77077
77177
77277
77377
77477
77577
77677
77777
77877
77977
78087
78187
78287
78387
78487
78587
78687
78787
78887
78987
79097
79197
79297
79397
79497
79597
79697
79797
79897
79997
80008
80108
80208
80308
80408
80508
80608
80708
80808
80908
81018
81118
81218
81318
81418
81518
81618
81718
81818
81918
82028
82128
82228
82328
82428
82528
82628
82728
82828
82928
83038
83138
83238
83338


Fixed submission (verdict: Accepted):
input_one = input().split()
i = int(input_one[0])
two = input_one[1]
count = 0



while  i <= int(two):
    
    i = str(i)
    if i[0] == i[4]:
        if i[1] == i[3]:
            count += 1

    i = int(i) + 1
print(count)
Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
count = 0

for i in range(A, B+1):
    i = str(i)
    if i[:2] == i[-2:]:
        count += 1
    
print(count)

Failing test case input:
31415 62064

Expected output:
306


Actual output:
307


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

for i in range(A, B+1):
    i = str(i)
    if i[:2] == i[:-3:-1]:
        count += 1
    
print(count)

Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    i = str(i)
    if i[:2] == i[-2:]:
        ans += 1
print(ans)

Failing test case input:
15858 19549

Expected output:
36


Actual output:
37


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    i = str(i)
    if i[:2] == i[:2:-1]:
        ans += 1
print(ans)

Problem: p03416
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A, B = map(int, input().split())

cnt = 0
for n in range(A, B + 1):
    s = str(n)
    if s[:2] == s[3:]:
        cnt += 1

print(cnt)


Failing test case input:
38168 41187

Expected output:
31


Actual output:
30


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

cnt = 0
for n in range(A, B + 1):
    s = str(n)
    if s[:2] == s[4] + s[3]:
        cnt += 1

print(cnt)

Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split()) 
c = 0
for i in range(1,10):
  for j in range(0,10):
    for k in range(0,10):
      x = 10001*i+1010*j+100*k
      if x >= a and x <= b:
        c += 1

Failing test case input:
15714 19549

Expected output:
38


Actual output:

Fixed submission (verdict: Accepted):
a,b = map(int,input().split()) 
c = 0
for i in range(1,10):
  for j in range(0,10):
    for k in range(0,10):
      x = 10001*i+1010*j+100*k
      if x >= a and x <= b:
        c += 1
print(c)

Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b =map(int, input().split())
count=0
for i in range(a+1,b+1):
    m = list(str(i))
    if m[0]==m[3]:
        if m[1]==m[2]:
            count+=1
print(count)

Failing test case input:
25468 42009

Expected output:
165


Actual output:
170


Fixed submission (verdict: Accepted):
a, b =map(int, input().split())
count=0
for i in range(a,b+1):
    m = list(str(i))
    if m[0]==m[4]:
        if m[1]==m[3]:
            count+=1
print(count)

Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
  s = list(str(i))
  left = s[0:2]
  right = s[3:]
  if left == right:
    ans += 1
print(ans)

Failing test case input:
15435 22770

Expected output:
74


Actual output:
73


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
  s = list(str(i))
  left = s[0:2]
  right = s[3:]
  right.reverse()
  if left == right:
    ans += 1
print(ans)
Problem: p03416
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int, input().split())

ans = 0
for i in range(a, b+1):
    if str(i)[:2] == str(i)[3:]:
        ans += 1
print(ans)

Failing test case input:
11516 30706

Expected output:
192


Actual output:
191


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

ans = 0
for i in range(a, b+1):
    if str(i)[:2] == str(i)[-1:-3:-1]:
        ans += 1
print(ans)

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

count = 0
for q in range(A, B):
    if str(q)[:2] == str(q)[-2:]:
        count += 1
print(count)


Failing test case input:
31415 62064

Expected output:
306


Actual output:
307


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

count = 0
for q in range(A, B + 1):
    w = str(q)
    if w[:2] == (w[-1] + w[-2]):
        count += 1
print(count)

Problem: p03416
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b =map(int, input().split())
count=0
for i in range(a,b):
    m = list(str(i))
    if m[0]==m[3]:
        if m[1]==m[2]:
            count+=1
print(count)

Failing test case input:
10845 11333

Expected output:
5


Actual output:
10


Fixed submission (verdict: Accepted):
a, b =map(int, input().split())
count=0
for i in range(a,b+1):
    m = list(str(i))
    if m[0]==m[4]:
        if m[1]==m[3]:
            count+=1
print(count)
Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c,d = map(int, input().split())
s = a+b
t = c+d

if s>t:
  print("Left")
if s<t:
  print("Right")
else:
  print("Balanced")

Failing test case input:
1 9 0 2

Expected output:
Left


Actual output:
Left
Balanced


Fixed submission (verdict: Accepted):
a,b,c,d = map(int, input().split())
s = a+b
t = c+d

if s>t:
  print("Left")
elif s<t:
  print("Right")
else:
  print("Balanced")

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



def main():
    
    a, b, c, d = map(int, input().split())
    if a+b < c+d:
        print("Right")
    if a+b == c+d:
        print("Balanced")
    else:
        print("Left")


if __name__ == "__main__":
    main()


Failing test case input:
1 1 6 8

Expected output:
Right


Actual output:
Right
Left


Fixed submission (verdict: Accepted):



def main():
    
    a, b, c, d = map(int, input().split())
    if a+b < c+d:
        print("Right")
    elif a+b == c+d:
        print("Balanced")
    else:
        print("Left")


if __name__ == "__main__":
    main()

Problem: p03477
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c,d=map(int,input().split())
if a+b>c+d:
  print('Right')
elif (a+b)==(c+d):
  print('Balanced')
else:
  print('Left')
 

Failing test case input:
-6 3 1 1

Expected output:
Right


Actual output:
Left


Fixed submission (verdict: Accepted):
a,b,c,d=map(int,input().split())
if a+b>c+d:
  print('Left')
elif (a+b)==(c+d):
  print('Balanced')
else:
  print('Right')

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

import sys


def main(argv=sys.argv):
  a, b, c, d = map(int, input().split(' '))
  
  if a + b > c + d:
    print('left')
  elif a + b < c + d:
    print('Right')
  else:
    print('Balanced')
    
    
  return 0


if __name__ == '__main__':
  sys.exit(main())

Failing test case input:
0 18 1 0

Expected output:
Left


Actual output:
left


Fixed submission (verdict: Accepted):

import sys


def main(argv=sys.argv):
  a, b, c, d = map(int, input().split(' '))
  
  if a + b > c + d:
    print('Left')
  elif a + b < c + d:
    print('Right')
  else:
    print('Balanced')
    
    
  return 0


if __name__ == '__main__':
  sys.exit(main())

Problem: p03477
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b,c,d = map(str,input().split())
print("Left" if a+b > c+d else "Balanced" if (a+b) == (c+d) else "Right")


Failing test case input:
-1 18 1 0

Expected output:
Left


Actual output:
Right


Fixed submission (verdict: Accepted):
a,b,c,d = map(int,input().split())
print("Left" if a+b > c+d else "Balanced" if (a+b) == (c+d) else "Right")

Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c,d=map(int, input().split())
if(a+b)>(c+d):
    print("Left")
if(a+b)==(c+d):
    print("Balanced")
else:
    print("Right")

Failing test case input:
2 5 0 1

Expected output:
Left


Actual output:
Left
Right


Fixed submission (verdict: Accepted):
a,b,c,d=map(int, input().split())
if(a+b)>(c+d):
    print("Left")
if(a+b)==(c+d):
    print("Balanced")
elif(a+b)<(c+d):
    print("Right")
Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C, D = map(int, input().split())
if A+B == C+D:
  print("Balanced")
if A+B > C+D:
  print("Left")
if A+B < C+D:
  print("Balanced")


Failing test case input:
-1 2 3 5

Expected output:
Right


Actual output:
Balanced


Fixed submission (verdict: Accepted):
A, B, C, D = map(int, input().split())
if A+B == C+D:
  print("Balanced")
if A+B > C+D:
  print("Left")
if A+B < C+D:
  print("Right")

Problem: p03477
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())
if a + b > c + d:
    print('Left')
elif a + b < c + d:
    print("Right")
else:
    print("Right")

Failing test case input:
8 3 8 3

Expected output:
Balanced


Actual output:
Right


Fixed submission (verdict: Accepted):
a, b, c, d = map(int, input().split())
if a + b > c + d:
    print('Left')
elif a + b < c + d:
    print("Right")
else:
    print("Balanced")

Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())
if a + b == c + d:
    print("Balance")
elif a + b < c + d:
    print("Right")
else:
    print("Left")


Failing test case input:
0 8 7 1

Expected output:
Balanced


Actual output:
Balance


Fixed submission (verdict: Accepted):
a, b, c, d = map(int, input().split())
if a + b == c + d:
    print("Balanced")
elif a + b < c + d:
    print("Right")
else:
    print("Left")

Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())
if a + b > c + d:
    print("left")
elif a + b == c + d:
    print("Balanced")
else:
    print("Right")

Failing test case input:
2 5 0 1

Expected output:
Left


Actual output:
left


Fixed submission (verdict: Accepted):
a, b, c, d = map(int, input().split())
if a + b > c + d:
    print("Left")
elif a + b == c + d:
    print("Balanced")
else:
    print("Right")

Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c, d = map(int,input().split())
if a + b > c + d:
    print('Left')
elif a + b < c + d:
    print('Balanced')
else:
    print('Right')

Failing test case input:
12 6 33 2

Expected output:
Right


Actual output:
Balanced


Fixed submission (verdict: Accepted):
a, b, c, d = map(int,input().split())
if a + b > c + d:
    print('Left')
elif a + b < c + d:
    print('Right')
else:
    print('Balanced')

Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c,d=map(int,input().split())
if a+b<c+d:
    print('Right')
elif a+b>c+d:
    print('Left')
else:
    ('Balanced')


Failing test case input:
8 3 8 3

Expected output:
Balanced


Actual output:

Fixed submission (verdict: Accepted):
a,b,c,d=map(int,input().split())
if a+b<c+d:
    print('Right')
elif a+b==c+d:
    print('Balanced')
else:
    print('Left')
Problem: p03477
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())

left = a + b
right = c + d

if left == right:
  print("Balanced")
elif left > right:
  print("Left")
else:
  print("Rigtht")

Failing test case input:
0 1 6 3

Expected output:
Right


Actual output:
Rigtht


Fixed submission (verdict: Accepted):
a, b, c, d = map(int, input().split())
 
left = a + b
right = c + d
 
if left == right:
  print("Balanced")
elif left > right:
  print("Left")
else:
  print("Right")

Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C, D = map(int, input().split())
 
if A + B == C + D:
  r = 'Balanced'
if A + B > C + D:
  r = 'Left'
else:
  r = 'Right'
print(r)

Failing test case input:
3 4 5 2

Expected output:
Balanced

Actual output:
Right


Fixed submission (verdict: Accepted):
A, B, C, D = map(int, input().split())
 
if (A + B) == (C + D):
  r = 'Balanced'
elif (A + B) > (C + D):
  r = 'Left'
elif (A + B) < (C + D):
  r = 'Right'
print(r)

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

r=A+B
l=C+D

if r>l:
    print("Right")
elif l>r:
    print("Left")
else:
    print("Balanced")

Failing test case input:
2 25 3 1

Expected output:
Left


Actual output:
Right


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

l=A+B
r=C+D

if r>l:
    print("Right")
elif l>r:
    print("Left")
else:
    print("Balanced")

Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c,d = map(int, input().split())
if a+b < c+d:
  print("Left")
elif a+b == c+d:
  print("Balanced")
else:
  print("Right")

Failing test case input:
2 2 33 1

Expected output:
Right


Actual output:
Left


Fixed submission (verdict: Accepted):
a,b,c,d = map(int, input().split())
if a+b > c+d:
  print("Left")
elif a+b == c+d:
  print("Balanced")
else:
  print("Right")

Problem: p03477
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):





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





if A+B>=C+D:
    print("Left")
if A+B==C+D:
    print("Balanced")
else:
    print("Right")

Failing test case input:
2 3 0 0

Expected output:
Left


Actual output:
Left
Right


Fixed submission (verdict: Accepted):





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





if A+B>C+D:
    print("Left")
elif A+B==C+D:
    print("Balanced")
else:
    print("Right")

Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
a,b,c,d=map(str,input().split())

l=a+b
r=c+d
if l==r:
  print('Balanced')
elif l>r:
  print('Right')
else:
  print('Left')

Failing test case input:
-6 2 1 1

Expected output:
Right


Actual output:
Left


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
a,b,c,d=map(int,input().split())

l=a+b
r=c+d
if l==r:
  print('Balanced')
elif l>r:
  print('Left')
else:
  print('Right')
Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

slist = s.split(" ")

left = int(slist[0]) + int(slist[1])

right = int(slist[2]) + int(slist[3])

if left > right:
    print("left")
	
elif left == right:
    print("Balanced")
	
else:
    print("right")


Failing test case input:
0 34 1 1

Expected output:
Left


Actual output:
left


Fixed submission (verdict: Accepted):
s = input()

slist = s.split(" ")

left = int(slist[0]) + int(slist[1])

right = int(slist[2]) + int(slist[3])

if left > right:
	print("Left")
	
elif left == right:
	print("Balanced")
	
else:
	print("Right")

Problem: p03477
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())
if a+b > c+d:
    print('Left')
elif a+b < c+d:
    print('right')
else:
    print('Balanced')


Failing test case input:
12 6 33 2

Expected output:
Right


Actual output:
right


Fixed submission (verdict: Accepted):
a, b, c, d = map(int, input().split())
if a+b > c+d:
    print('Left')
elif a+b < c+d:
    print('Right')
else:
    print('Balanced')
Problem: p02727
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

X, Y, A, B, C = map(int,input().split())
p0 = list(map(int,input().split()))
q0 = list(map(int,input().split()))
r0 = list(map(int,input().split()))
p = sorted(p0, reverse = True); p.append(0)
q = sorted(q0, reverse = True); q.append(0)
r = sorted(r0, reverse = True); r.append(0)

happy = 0
i = 0
j = 0
k = 0
red = 0
green = 0
white = 0

for _ in range(X+Y):
    if r[k] >= p[i] and r[k] >= q[j]:
        happy += r[k]
        white += 1
        k += 1
    elif p[i] > q[j]:
        if red != X:
            happy += p[i]
            red += 1
            i += 1
        elif q[j] >= r[k] and green != Y:
            happy += q[j]
            green += 1
            j += 1
    elif p[i] <= q[j]:
        if green != Y:
            happy += q[j]
            green += 1
            j += 1
        elif p[i] >= r[k] and red != X:
            happy += p[i]
            red += 1
            i += 1
            
print(happy)

Failing test case input:
2 0 -2 0 6
28 -2
9 -1
2 -1

Expected output:
30


Actual output:
28


Fixed submission (verdict: Accepted):

X, Y, A, B, C = map(int,input().split())
p0 = list(map(int,input().split()))
q0 = list(map(int,input().split()))
r0 = list(map(int,input().split()))
p = sorted(p0, reverse = True); p.append(0)
q = sorted(q0, reverse = True); q.append(0)
r = sorted(r0, reverse = True); r.append(0)

happy = 0
i = 0
j = 0
k = 0
red = 0
green = 0
white = 0

for _ in range(X+Y):
    if max(p[i], q[j], r[k]) == r[k]:
        happy += r[k]
        white += 1
        k += 1
    elif max(p[i], q[j], r[k]) == p[i]:
        if red < X:
            happy += p[i]
            red += 1
            i += 1
        elif q[j] >r[k] and green < Y:
            happy += q[j]
            green += 1
            j += 1
        else:
            happy += r[k]
            white += 1
            k += 1
    else:
        if green < Y:
            happy += q[j]
            green += 1
            j += 1
        elif p[i] >r[k] and red < X:
            happy += p[i]
            red += 1
            i += 1
        else:
            happy += r[k]
            white += 1
            k += 1
            
print(happy)

Problem: p02727
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
from itertools import chain

def readlines(*abc):
    for n in abc:
        yield list(map(int, input().split()))[:n]

def main():
    x, y, a, b, c = map(int, input().split())
    apples = sorted(chain(*readlines(a,b,c)), reverse=True)
    print(sum(apples[:x+y]))


main()




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

Expected output:
8


Actual output:
2


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
from itertools import chain

def readlines(*xy):
    for n in xy:
        yield sorted(map(int, input().split()), reverse=True)[:n]

def main():
    x, y, a, b, c = map(int, input().split())
    apples = sorted(chain(*readlines(x,y,c)), reverse=True)
    print(sum(apples[:x+y]))


main()
Problem: p02727
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X, Y, A, B, C = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))

P = sorted(P, reverse=True)[:X]
Q = sorted(P, reverse=True)[:Y]
R = sorted(P, reverse=True)[:X+Y]

print(sum(sorted(P+Q+R, reverse=True)[:X+Y]))


Failing test case input:
2 2 1 4 4
11 12 13 21
21 20 8 24
1 2 3 4

Expected output:
79


Actual output:
76


Fixed submission (verdict: Accepted):
X, Y, A, B, C = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))

P = sorted(P, reverse=True)[:X]
Q = sorted(Q, reverse=True)[:Y]
R = sorted(R, reverse=True)[:X+Y]

print(sum(sorted(P+Q+R, reverse=True)[:X+Y]))

Problem: p02727
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from collections import Counter
input = sys.stdin.readline

X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort()
q.sort()
r.sort()

if A > X:
    p = p[-X:]
if B > Y:
    q = q[-X:]

p.extend(q)
p.extend(r)

p.sort()

print(sum(p[-(X+Y):]))

Failing test case input:
2 0 4 4 4
11 15 13 14
21 22 23 22
1 4 3 4

Expected output:
29


Actual output:
45


Fixed submission (verdict: Accepted):
import sys
from collections import Counter
input = sys.stdin.readline

X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

ans = []

ans.extend(sorted(p, reverse=True)[:X])
ans.extend(sorted(q, reverse=True)[:Y])
ans.extend(r)
ans.sort(reverse=True)

print(sum(ans[:X+Y]))