Problem p03240 (python)

Fixed submission:
N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

for cxi in range(101):
    for cyi in range(101):
        for k in range(N):
            if params[k][2] > 0:
                hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

        for k in range(N):
            if params[k][2] != max((hight - abs(params[k][0] - cxi) - abs(params[k][1] - cyi)), 0):
                break
        
        else:
            print(cxi, cyi, hight)

Buggy submission (verdict: Runtime Error):
N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

for cxi in range(101):
    for cyi in range(101):
        for k in range(N):
            if params[k][2] > 0:
                hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

        for k in range(N):
            if params[k][2] != max((hight - abs(params[k][0] - cxi) - abs(params[k][1] - cyi)), 0)
                break
        
        else:
            print(cxi, cyi, hight)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

for (cxi, cyi) in itertools.product(range(101), range(101)):
    for k in range(N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

    for k in range(N):
        if params[k][2] != max((hight - abs(params[k][0] - cxi) - abs(params[k][1] - cyi)), 0)
            break
    
    else:
        print(cxi, cyi, hight)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

for cxi, cyi in itertools.product(range(101), range(101)):
    for k in range(N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

    for k in range(N):
        if params[k][2] != max((hight - abs(params[k][0] - cxi) - abs(params[k][1] - cyi)), 0)
            break
    
    else:
        print(cxi, cyi, hight)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

for cxi, cyi in itertools.product(range(101), range(101)):
    for k in range(N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

    for k in range(N):
        if params[k][2] != max(hight - abs(params[k][0] - cxi) - abs(params[k][1] - cyi), 0)
            break
    
    else:
        print(cxi, cyi, hight)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

for cxi, cyi in itertools.product(range(101), range(101)):
    for k in range(N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

    for k in range(N):
        if params[k][2] != max(h - abs(params[k][0] - cxi) - abs(params[k][1] - cyi), 0)
            break
    
    else:
        print(cxi, cyi, hight)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

for cxi, cyi in itertools.product(range(101), range(101)):
    for k in range(N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

    for i in range(N):
        if params[i][2] != max(h - abs(params[k][0] - cxi) - abs(params[k][1] - cyi), 0)
            break
    
    else:
        print(cxi, cyi, hight)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

for cxi, cyi in itertools.product(range(101), range(101)):
    for k in range(N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

    for i in range(N):
        if params[i][2] != max(h - abs(params[k][0] - cxi) - abs(params[k][1] - cyi), 0)
            break
    
    else:
        Cx = cxi
        Cy = cyi
        H = hight
        print(Cx, Cy, H)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

#if len(params) == 1:
#    print(*params[0])

#else:

#Cx, Cy, H = 0, 0, 0
for cxi, cyi in itertools.product(range(101), range(101)):
    hight_ = params[0][2] + abs(params[0][0] - cxi) + abs(params[0][1] - cyi)

    for k in range(N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

            if hight < 1:
                break
            else:
                if hight != hight_:
                    break
                else:
                    hight_ = hight
                    continue

        #elif params[k][2] == 0:
        #    if 1 > (abs(params[k][0] - cxi) + abs(params[k][1] - cyi)):
        #        break
    
    else:
        Cx = cxi
        Cy = cyi
        H = hight
    
    continue

print(Cx, Cy, H)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

#if len(params) == 1:
#    print(*params[0])

#else:

#Cx, Cy, H = 0, 0, 0
for cxi, cyi in itertools.product(range(101), range(101)):
    hight_ = params[0][2] + abs(params[0][0] - cxi) + abs(params[0][1] - cyi)

    for k in range(N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

            if hight < 1:
                break
            else:
                if hight != hight_:
                    break
                else:
                    hight_ = hight

        elif params[k][2] == 0:
            if 1 > (abs(params[k][0] - cxi) + abs(params[k][1] - cyi)):
                break
    
    else:
        Cx = cxi
        Cy = cyi
        H = hight
    continue

print(Cx, Cy, H)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

#if len(params) == 1:
#    print(*params[0])

#else:

#Cx, Cy, H = 0, 0, 0
for cxi, cyi in itertools.product(range(101), range(101)):
    hight_ = params[0][2] + abs(params[0][0] - cxi) + abs(params[0][1] - cyi)

    for k in range(N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

            if hight < 1:
                break
            else:
                if hight != hight_:
                    break
                else:
                    hight_ = hight

        #elif params[k][2] == 0:
        #    if 1 > (abs(params[k][0] - cxi) + abs(params[k][1] - cyi)):
        #        break
    
    else:
        Cx = cxi
        Cy = cyi
        H = hight
    continue

print(Cx, Cy, H)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

#if len(params) == 1:
#    print(*params[0])

#else:

#Cx, Cy, H = 0, 0, 0
for cxi, cyi in itertools.product(range(101), range(101)):
    hight_ = params[0][2] + abs(params[0][0] - cxi) + abs(params[0][1] - cyi)

    for k in range(1, N):
        if params[k][2] > 0:
            hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

            if hight < 1:
                break
            else:
                if hight != hight_:
                    break
                else:
                    hight_ = hight

        #elif params[k][2] == 0:
        #    if 1 > (abs(params[k][0] - cxi) + abs(params[k][1] - cyi)):
        #        break
    
    else:
        Cx = cxi
        Cy = cyi
        H = hight
    continue

print(Cx, Cy, H)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

if len(params) == 1:
    print(*params[0])

else:

    #Cx, Cy, H = 0, 0, 0
    for cxi, cyi in itertools.product(range(101), range(101)):
        hight_ = params[0][2] + abs(params[0][0] - cxi) + abs(params[0][1] - cyi)

        for k in range(1, N):
            if params[k][2] > 0:
                hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)

                if hight < 1:
                    break
                else:
                    if hight != hight_:
                        break
                    else:
                        hight_ = hight

            #elif params[k][2] == 0:
            #    if 1 > (abs(params[k][0] - cxi) + abs(params[k][1] - cyi)):
            #        break

        else:
            Cx = cxi
            Cy = cyi
            H = hight
        continue

    print(Cx, Cy, H)

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

if len(params) == 1:
    print(*params[0])

else:

    #Cx, Cy, H = 0, 0, 0
    for cxi, cyi in itertools.product(range(101), range(101)):
        hight_ = params[0][2] + abs(params[0][0] - cxi) + abs(params[0][1] - cyi)

        #counter = 0
        for k in range(1, N):
            if params[k][2] > 0:
                hight = params[k][2] + abs(params[k][0] - cxi) + abs(params[k][1] - cyi)
                #if counter == 0:
                #    hight_ = hight
                #counter += 1

                if hight < 1:
                    break
                else:
                    if hight != hight_:
                        break
                    else:
                        hight_ = hight
            elif params[k][2] == 0:
                if 1 > (abs(params[k][0] - cxi) + abs(params[k][1] - cyi)):
                    break

        else:
            Cx = cxi
            Cy = cyi
            H = hight
        continue

    print(Cx, Cy, H)

Buggy submission (verdict: Runtime Error):
N = int(input())
params = []
for i in range(N):
    xyh = [int(n) for n in input().split()]
    params.append(xyh)

import itertools

for cxi, cyi in itertools.product(range(101), range(101)):
    counter = 0
    for x, y, h in params:
        hight = h + abs(x - cxi) + abs(y - cyi)
        if counter == 0:
            hight_ = hight
        counter += 1

        if hight < 1:
            break
        else:
            if hight != hight_:
                break
            else:
                hight_ = hight

    else:
        Cx = cxi
        Cy = cyi
        H = hight
    continue

print(Cx, Cy, H)