Problem p03240 (python)

Fixed submission:
N = int(input())

array = []

for i in range(N):
    array.append(list(map(int,input().split())))

test = []

t = []

for x in range(101):
    for y in range(101):
        H = []
        for i in array:
            if i[2] > 0:
                H_i = max(abs(i[0]-x)+abs(i[1]-y)+i[2],0)
                H.append(H_i)
        Hset = set(H)
        H = list(Hset)[0]
        if(len(Hset)==1 and H>=0):
            t.append([x,y,H])

if len(t) >= 2:
    t = []
    for x in range(101):
        for y in range(101):
            H = []
            for i in array:
                if True:
                    H_i = max(abs(i[0]-x)+abs(i[1]-y)+i[2],0)
                    H.append(H_i)
            Hset = set(H)
            H = list(Hset)[0]
            if(len(Hset)==1 and H>=0):
                t.append([x,y,H])
            
print("{0[0]} {0[1]} {0[2]}".format(t[0]))

Buggy submission (verdict: Runtime Error):
N = int(input())

array = []

for i in range(N):
    array.append(list(map(int,input().split())))

test = []

t = []

for x in range(101):
    for y in range(101):
        H = []
        for i in array:
            if i[2] > 0:
                H_i = max(abs(i[0]-x)+abs(i[1]-y)+i[2],0)
                H.append(H_i)
        Hset = set(H)
        H = list(Hset)[0]
        if(len(Hset)==1 and H>=0):
            t.append([x,y,H])

t = []

if len(t) >=2:
    for x in range(101):
        for y in range(101):
            H = []
            for i in array:
                if True:
                    H_i = max(abs(i[0]-x)+abs(i[1]-y)+i[2],0)
                    H.append(H_i)
            Hset = set(H)
            H = list(Hset)[0]
            if(len(Hset)==1 and H>=0):
                t.append([x,y,H])
            
print("{0[0]} {0[1]} {0[2]}".format(t[0]))

Buggy submission (verdict: Runtime Error):
N = int(input())

array = []

for i in range(N):
    array.append(list(map(int,input().split())))

test = []

t = []

for x in range(101):
    for y in range(101):
        H = []
        for i in array:
            if i[2] > 0:
                H_i = max(abs(i[0]-x)+abs(i[1]-y)+i[2],0)
                H.append(H_i)
        Hset = set(H)
        H = list(Hset)[0]
        if(len(Hset)==1 and H>=0):
            t.append([x,y,H])

if len(t) >=2:
    x = 15/0
            
print("{0[0]} {0[1]} {0[2]}".format(t[0]))

Buggy submission (verdict: Runtime Error):
N = int(input())

array = []

for i in range(N):
    array.append(list(map(int,input().split())))

test = []

t = []

for x in range(101):
    for y in range(101):
        H = []
        for i in array:
            if i[2] > 0:
                H_i = max(abs(i[0]-x)+abs(i[1]-y)+i[2],0)
                H.append(H_i)
        Hset = set(H)
        H = list(Hset)[0]
        if(len(Hset)==1 and H>=0):
            t.append([x,y,H])

if len(t) >=2:
    x = 15/0
            
print("{0[0]} {0[1]} {0[2]}".format(t))

Buggy submission (verdict: Runtime Error):
N = int(input())

array = []

for i in range(N):
    array.append(list(map(int,input().split())))

test = []

for x in range(101):
    for y in range(101):
        H=[]
        for i in array:
            H_i = max(abs(i[0]-x)+abs(i[1]-y)+i[2],0)
            H.append(H_i)
        Hset = set(H)
        H = list(Hset)[0]
        if(len(Hset)==1 and H>=0):
            test.append(H)
            # print(x,y,H)
            
if(len(test)==0):
    print(5/0)
else:
    print(x,y,H)

Buggy submission (verdict: Runtime Error):
N = int(input())

array = []

for i in range(N):
    array.append(list(map(int,input().split())))

test = []

for x in range(101):
    for y in range(101):
        H=[]
        for i in array:
            H_i = max(abs(i[0]-x)+abs(i[1]-y)+i[2],0)
            H.append(H_i)
        Hset = set(H)
        H = list(Hset)[0]
        if(len(Hset)==1 and H>=0):
            test.append(H)
            # print(x,y,H)
            
if(len(test)!=1):
    print(5/0)
else:
    print(x,y,H)