Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_array = np.array(A)
B_array = np.array(B)
A_cum = np.cumsum(A_array)
B_cum = np.cumsum(B_array)
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    a = 0
    b = len(B_cum)-1
    print(B_check)
    while b - a != 0:
        c = int(round((a+b)/2))
        if B_check[c] < 0:
            b = c
        else:
            a = c
        if b-a == 1:
            if B_check[b] < 0:
                b = a
            else:
                a = b
    check = i+b+2
    if check>ans:
        ans = check
print(ans)

Fixed submission:
import bisect
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_cum = [0]
B_cum = [0]
A_cum[0] = A[0]
for j in range(len(A)-1):
    A_cum.append(A_cum[j]+ A[j+1])
B_cum[0] = B[0]
for l in range(len(B)-1):
    B_cum.append(B_cum[l] + B[l+1])
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    b = bisect.bisect(B_cum,K-k)
    check = i+b+1
    if check>ans:
        ans = check
check = bisect.bisect(B_cum,K)
if check>ans:
    ans = check    
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_array = np.array(A)
B_array = np.array(B)
A_cum = np.cumsum(A_array)
B_cum = np.cumsum(B_array)
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    a = 0
    b = len(B_cum)-1
    print(B_check)
    while b - a != 0:
        c = int(round((a+b)/2))
        if B_check[c] < 0:
            b = c
        else:
            a = c
        if b-a == 1:
            if B_check[b] < 0:
                b = a
            else:
                a = b
    check = i+b+2
    if check>ans:
        ans = check
print(ans)

Fixed submission:
import bisect
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_cum = [0]
B_cum = [0]
A_cum[0] = A[0]
for j in range(len(A)-1):
    A_cum.append(A_cum[j]+ A[j+1])
B_cum[0] = B[0]
for l in range(len(B)-1):
    B_cum.append(B_cum[l] + B[l+1])
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    b = bisect.bisect(B_cum,K-k)
    check = i+b+1
    if check>ans:
        ans = check
check = bisect.bisect(B_cum,K)
if check>ans:
    ans = check    
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_array = np.array(A)
B_array = np.array(B)
A_cum = np.cumsum(A_array)
B_cum = np.cumsum(B_array)
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    a = 0
    b = len(B_cum)-1
    print(B_check)
    while b - a != 0:
        c = round((a+b)/2)
        if B_check[c] < 0:
            b = c
        else:
            a = c
        if b-a == 1:
            if B_check[b] < 0:
                b = a
            else:
                a = b
    check = i+b+2
    if check>ans:
        ans = check
print(ans)

Fixed submission:
import bisect
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_cum = [0]
B_cum = [0]
A_cum[0] = A[0]
for j in range(len(A)-1):
    A_cum.append(A_cum[j]+ A[j+1])
B_cum[0] = B[0]
for l in range(len(B)-1):
    B_cum.append(B_cum[l] + B[l+1])
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    b = bisect.bisect(B_cum,K-k)
    check = i+b+1
    if check>ans:
        ans = check
check = bisect.bisect(B_cum,K)
if check>ans:
    ans = check    
print(ans)