Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
　　a.append(a[i] + A[i])
for i in range(M):
　　b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
　　if a[i] > K:
　　　　break
　　while b[j] > K - a[i]:
　　　　j -= 1
　　ans = max(ans, i + j)
print(ans)

Fixed submission:
import numpy as np


def main():
    N, M, K = map(int, input().split())
    A = np.array([0] + [int(i) for i in input().split()])
    B = np.array([0] + [int(i) for i in input().split()])

    A.cumsum(out=A)
    B.cumsum(out=B)

    ans = 0
    j = M
    for i in range(N + 1):
        if A[i] > K:
            break
        while B[j] + A[i] > K:
            j -= 1
        ans = max(ans, i + j)

    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
1 N, M, K = map(int, input().split())
2 A = list(map(int, input().split()))
3 B = list(map(int, input().split()))
4
5 a, b = [0], [0]
6 for i in range(N):
7 　　a.append(a[i] + A[i])
8 for i in range(M):
9 　　b.append(b[i] + B[i])
10
11 ans, j = 0, M
12 for i in range(N + 1):
13 　　if a[i] > K:
14 　　　　break
15　　 while b[j] > K - a[i]:
16 　　　　j -= 1
17 　　ans = max(ans, i + j)
18 print(ans)


Fixed submission:
import numpy as np


def main():
    N, M, K = map(int, input().split())
    A = np.array([0] + [int(i) for i in input().split()])
    B = np.array([0] + [int(i) for i in input().split()])

    A.cumsum(out=A)
    B.cumsum(out=B)

    ans = 0
    j = M
    for i in range(N + 1):
        if A[i] > K:
            break
        while B[j] + A[i] > K:
            j -= 1
        ans = max(ans, i + j)

    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
1 N, M, K = map(int, input().split())
2 A = list(map(int, input().split()))
3 B = list(map(int, input().split()))
4
5 a, b = [0], [0]
6 for i in range(N):
7 	a.append(a[i] + A[i])
8 for i in range(M):
9 	b.append(b[i] + B[i])
10
11 ans, j = 0, M
12 for i in range(N + 1):
13 　　if a[i] > K:
14 		　break
15 　while b[j] > K - a[i]:
16 　　j -= 1
17 　ans = max(ans, i + j)
18 print(ans)


Fixed submission:
import numpy as np


def main():
    N, M, K = map(int, input().split())
    A = np.array([0] + [int(i) for i in input().split()])
    B = np.array([0] + [int(i) for i in input().split()])

    A.cumsum(out=A)
    B.cumsum(out=B)

    ans = 0
    j = M
    for i in range(N + 1):
        if A[i] > K:
            break
        while B[j] + A[i] > K:
            j -= 1
        ans = max(ans, i + j)

    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
input = sys.stdin.readline


def main():
    N, M, K = map(int, input().split())
    A = np.array([0] + [int(i) for i in input().split()])
    B = np.array([0] + [int(i) for i in input().split()])

    A.cumsum(out=A)
    B.cumsum(out=B)
    ans = 0

    for i in range(N + 1):
        if A[i] > K:
            break

    A_max_i = i
    B_min_i = 0
    for A_i in range(A_max_i, -1, -1):
        for B_i in range(B_min_i, M + 1):
            if A[A_i] + B[B_i] > K:
                break
        else:
            B_i += 1
        ans = max(ans, A_i + B_i - 1)

    print(ans)


if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np


def main():
    N, M, K = map(int, input().split())
    A = np.array([0] + [int(i) for i in input().split()])
    B = np.array([0] + [int(i) for i in input().split()])

    A.cumsum(out=A)
    B.cumsum(out=B)

    ans = 0
    j = M
    for i in range(N + 1):
        if A[i] > K:
            break
        while B[j] + A[i] > K:
            j -= 1
        ans = max(ans, i + j)

    print(ans)


if __name__ == '__main__':
    main()