Problem: In the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.   The pyramid had _center coordinates_ (C_X, C_Y) and _height_ H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).  Aoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:    * C_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.    * Additionally, he obtained N pieces of information. The i-th of them is: "the altitude of point (x_i, y_i) is h_i."   This was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.

Submission attempts (in order):
#112
from itertools import product

N=int(input())
px,py,ph=[],[],[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)
        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

for Cxi,Cyj in product(range(101),range(101)):

    if len(ph)!=1:
        for i in range(len(ph)):
            nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
            if nowH!=preH:
                break
            preH=nowH
        else:
            print(Cxi,Cyj,nowH)
            break
    else:
        print(px[0],py[0],ph[0])
        break

#112
from itertools import product

N=int(input())
px,py,ph=[],[],[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)
        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

for Cxi,Cyj in product(range(101),range(101)):

    if len(ph)!=1:
        for i in range(len(ph)):
            nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
            if nowH!=preH:
                break
            preH=nowH
        else:
            print(Cxi,Cyj,nowH)
            break
    else:
        print(px[0],py[0],ph[0])

#112
from itertools import product

N=int(input())
px,py,ph=[],[],[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)
        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

for Cxi,Cyj in product(range(101),range(101)):
    preH=alc_H(Cxi,Cyj,px[0],py[0],ph[0])
    for i in range(len(ph)):
        nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
        if nowH!=preH:
            break
        preH=nowH
    else:
        print(Cxi,Cyj,nowH)

#112
from itertools import product

N=int(input())
px,py,ph=[],[],[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)
        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

for Cxi,Cyj in product(range(101),range(101)):

    if len(ph)!=1:
        preH=Calc_H(Cxi,Cyj,px[0],py[0],ph[0])
        for i in range(len(ph)):
            nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
            if nowH!=preH:
                break
            preH=nowH
        else:
            print(Cxi,Cyj,nowH)
            break
    else:
        print(px[0],py[0],ph[0])
        break

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted