Problem p03078 (python)

Fixed submission:
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
sum_list = []
for a_i in range(x):
    for b_i in range(y):
        if a_i*b_i > k:
            break
        for c_i in range(z):
            if a_i*b_i*c_i > k:
                break
            sum_list.append(a[a_i]+b[b_i]+c[c_i])
sum_list.sort(reverse=True)
for i in range(k):
    print(sum_list[i])

Buggy submission (verdict: Runtime Error):
x,y,z,k = map(int,input().split())
a = list(map(int,input().split())).sort(reverse=True)
b = list(map(int,input().split())).sort(reverse=True)
c = list(map(int,input().split())).sort(reverse=True)

sum_list = []
for a_i in range(x):
    for b_i in range(y):
        for c_i in range(z):
            if a_i*b_i*c_i > k:
                continue
            sum_list.append(a[a_i]+b[b_i]+c[c_i])
sum_list.sort(reverse=True)
for i in range(k):
    print(sum_list[i])

Buggy submission (verdict: Runtime Error):
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab_list = []
for a_i in range(x):
    for b_i in range(y):
        ab_list.append(a[a_i]+b[b_i])
ab_list.sort(reverse=True)
sum_list = []
for ab_i in range(k):
    for c_i in range(z):
        sum_list.append(ab_list[ab_i]+c[c_i])
sum_list.sort(reverse=True)
for i in range(k):
    print(sum_list[i])

Buggy submission (verdict: Runtime Error):
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab_list = []
for a_i in range(x):
    for b_i in range(y):
        ab_list.append(a[a_i]+b[b_i])
ab_list.sort().reverse()
sum_list = []
for ab_i in range(k):
    for c_i in range(z):
        sum_list.append(ab_list[ab_i]+c[c_i])
sum_list.sort().reverse()
#sum_list = []
#for a_i in range(x):
#    for b_i in range(y):
#        for c_i in range(z):
#            sum_list.append(a[a_i]+b[b_i]+c[c_i])
#sum_list.sort()
for i in range(k):
    print(sum_list[i])

Buggy submission (verdict: Runtime Error):
x,y,z,k = map(int,input().split())
a = list(map(int,input().split())).sort()
b = list(map(int,input().split())).sort()
c = list(map(int,input().split())).sort()

ab_list = []
for a_i in range(x):
    for b_i in range(y):
        ab_list.append(a[a_i]+b[b_i])
ab_list.sort()
sum_list = []
for ab_i in range(k):
    for c_i in range(z):
        sum_list.append(ab_list[ab_i]+c[c_i])
sum_list.sort()
#sum_list = []
#for a_i in range(x):
#    for b_i in range(y):
#        for c_i in range(z):
#            sum_list.append(a[a_i]+b[b_i]+c[c_i])
#sum_list.sort()
for i in range(k):
    print(sum_list[i])

Buggy submission (verdict: Runtime Error):
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

sum_list = []
for a_i in range(x):
    for b_i in range(y):
        for c_i in range(z):
            sum_list.append(a[a_i]+b[b_i]+c[c_i])
sum_list.sort
for i in range(k):
    print(sum_list(i))