TnT/Multi_CodeNet4Repair huggingface dataset:
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):
N = int(input())
s = []
for _ in [0]*N:
    x, y, h = map(int, input().split())
    s.append([x, y, h])

s.sort(key=lambda x:x[2], reverse=True)
print(s)
ansH = 0
x0, y0, h0 = s[0]
for cx in range(0, 101):
    for cy in range(0, 101):
        H = h0 + abs(x0 - cx) + abs(y0 - cy)
        for x, y, h in s:
            if h == max(H - abs(x - cx) - abs(y - cy), 0):
                continue
            else:
                break
        else:
            print(cx, cy, H)

N = int(input())
s = []
for _ in [0]*N:
    x, y, h = map(int, input().split())
    s.append([x, y, h])

s.sort(key=lambda x:x[2], reverse=True)
ansH = 0
x0, y0, h0 = s[0]
for cx in range(0, 101):
    for cy in range(0, 101):
        H = h0 + abs(x0 - cx) + abs(y0 - cy)
        for x, y, h in s:
            if h == max(H - abs(x - cx) - abs(y - cy), 0):
                continue
            else:
                break
        else:
            print(cx, cy, H)

Verdicts: Wrong Answer

Accepted
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):
N=int(input())
x=[0]*N
y=[0]*N
h=[0]*N
for i in range(N):
  x[i],y[i],h[i]=map(int,input().split())

for i in range(55,56):
  for j in range(80,81):
    ans=set()
    for k in range(N):
      if h[k]>0:
        dist = abs(x[k]-i)+ abs(y[k]-j)
        height = h[k] + dist
        #print(x[k],y[k],dist,height)
        if len(ans)>0 and height not in ans:
          break
        else:
          ans.add(height)
    else:
      print(i,j,ans.pop())
      exit()

N=int(input())
x=[0]*N
y=[0]*N
h=[0]*N
for i in range(N):
  x[i],y[i],h[i]=map(int,input().split())

for i in range(101):
  for j in range(101):
    ans=[]
    for k in range(N):
      dist = abs(x[k]-i)+ abs(y[k]-j)
      height = h[k] + dist
      print(x[k],y[k],dist,height)
      if len(ans)>0 and height!=ans[0][1]:
        if ans[0][0]==0:
          ans[0]=[h[k],height]
        elif h[k]==0:
          pass
        else:
          break
      else:
        ans.append( [ h[k],height ] ) 
    else:
      print(i,j,ans[0][1])
      exit()

N=int(input())
x=[0]*N
y=[0]*N
h=[0]*N
for i in range(N):
  x[i],y[i],h[i]=map(int,input().split())

for i in range(55,56):
  for j in range(80,81):
    ans=[]
    for k in range(N):
      dist = abs(x[k]-i)+ abs(y[k]-j)
      height = h[k] + dist
      #print(x[k],y[k],dist,height)
      if len(ans)>0 and height!=ans[0][1]:
        if ans[0][0]==0:
          ans[0]=[h[k],height]
        elif h[k]==0:
          pass
        else:
          break
      else:
        ans.append([h[k],height])
    else:
      print(i,j,ans[0][1])
      exit()

N=int(input())
x=[0]*N
y=[0]*N
h=[0]*N
t=[0]*N
for i in range(N):
  x[i],y[i],h[i]=map(int,input().split())
  t[i]=[x[i],y[i],h[i]]

t.sort(key=lambda x:x[2],reverse=True)

for i in range(101):
  for j in range(101):
    ans=[]
    for k in t:
      d = abs(k[0]-i)+ abs(k[1]-j)
      h_tmp = d + k[2]
      if ans==[]:
        ans.append(k+[d,h_tmp])
      else:
        if d>ans[-1][-1] and k[2]==0:
          pass
        else:
          if h_tmp!=ans[-1][-1]:
            break
    else:
      print(i,j,ans[-1][-1])
      exit()


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
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):
N = int(input())
ans = set()
for i in range(N):
    x,y,h = (int(x) for x in input().split())
    if h > 0:
        for j in range(101):
            for k in range(101):
                ans.add((j,k,h+abs(j-x)+abs(k-y)))
        break
for i in range(N):
    x,y,h = (int(x) for x in input().split())
    temp = set()
    for j in range(101):
        for k in range(101):
            temp.add((j,k,h+abs(j-x)+abs(k-y)))
    if len(ans&temp) > 0:
        ans = ans & temp
for x in ans:
    print(*x)

N = int(input())
xyh = [tuple(map(int, input().split())) for _ in range(N)]
for x in xyh:
    if x[2] > 0:
        base = x
        break
for i in range(101):
    for j in range(101):
        h = base[2] + abs(i-base[0]) + abs(j-base[1])
        for x in xyh:
            if x[2] != max(h-abs(i-x[0])-abs(j-x[1]),0):
                break
        else:
            print(i,j,h)
            exit()

Verdicts: Runtime Error

Accepted
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):
MAX=100
for PosY in range(MAX+1):
    for PosX in range(MAX+1):
        needH=-1
        for i in range(N):
            tmp=xyh[i][2]+abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
            if needH==-1:
                needH=tmp
            else:
                if needH!=tmp:
                    needH=-2
                    break
        if needH==-2:
            continue
        for i in range(N):
            if xyh[i][2]==0:
                dist=abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH>dist:
                    needH=-2
                    break
        if needH==-2:
            continue
        print(PosX,PosY,needH)

N=int(input())
xyh=[list(map(int,input().split())) for i in range(N)]
MAX=100
for PosY in range(MAX+1):
    for PosX in range(MAX+1):
        needH=-1
        for i in range(N):
             if xyh[i][2]>0:
                tmp=xyh[i][2]+abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH==-1:
                    needH=tmp
                else:
                    if needH!=tmp:
                        needH=-2
                        break
        if needH==-2:
            continue
        for i in range(N):
            if xyh[i][2]==0:
                dist=abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH>dist:
                    needH=-2
                    break
        if needH==-2:
            continue
        print(PosX,PosY,needH)


Verdicts: Runtime Error

Accepted
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):
N=int(input())
xyh=[list(map(int, input().split())) for i in range(N)]

for i in range(101):
  for j in range(101):
    check=True
    h=abs(xyh[0][0]-i)+abs(xyh[0][1]-j)+xyh[0][2]
    
    for k in range(1, N):
      temph=abs(xyh[k][0]-i)+abs(xyh[k][1]-j)+xyh[k][2]
      if h!=temph:
        check=False
        
    if check:
      if 0<=h<=pow(10, 9):
      print(' '.join([str(i), str(j), str(h)]))

N=int(input())
xyh=[list(map(int, input().split())) for i in range(N)]

for i in range(101):
  for j in range(101):
    check=True
    h=abs(xyh[0][0]-i)+abs(xyh[0][1]-j)+xyh[0][2]
    
    for k in range(1, N):
      temph=abs(xyh[k][0]-i)+abs(xyh[k][1]-j)+xyh[k][2]
      if h!=temph:
        check=False
        
    if check:
      if 0<=h and h<=pow(10, 9):
      print(' '.join([str(i), str(j), str(h)]))

N=int(input())
xyh=[list(map(int, input().split())) for i in range(N)]
 
for i in range(101):
  for j in range(101):
    check=True
    k=0
    while xyh[k][2]==0:
      k+=1
      
    h=abs(xyh[k][0]-i)+abs(xyh[k][1]-j)+xyh[k][2]
    
    for k in range(N):
      temph=abs(xyh[k][0]-i)+abs(xyh[k][1]-j)+xyh[k][2]
      if xyh[k][2]==0:
        if temph<h:
          check=False
      else:
        if h!=temph:
          check=False
        
    if check==True and 0<h:
        print(' '.join([str(i), str(j), str(h)]))
        exit()
        
sonnnakannsuuhateigisiteinai()

Verdicts: Runtime Error

Runtime Error

Accepted
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):
n = int(input())
cx,cy = 0,0
list_xyh = []
for i in range(n):
    list_xyh.append(list(map(int, input().split())))
print(list_xyh)
for cx in range(0,101):
    for cy in range(0,101):
        H = abs(cx - list_xyh[0][0]) + abs(cy - list_xyh[0][1]) + list_xyh[0][2]
        for i in range(n):
            if list_xyh[i][2] != 0:
                if H - list_xyh[i][2] == abs(cx - list_xyh[i][0]) + abs(cy - list_xyh[i][1]):
                    continue
                else:
                    break
        else:
            print(cx,cy,H)
            break
    else:
        continue
    break


n = int(input())
cx,cy = 0,0
list_xyh = []
for i in range(n):
    list_xyh.append(list(map(int, input().split())))
for cx in range(0,101):
    for cy in range(0,101):
        for i in range(n):
            if list_xyh[i][2] != 0:
                H = abs(cx - list_xyh[i][0]) + abs(cy - list_xyh[i][1]) + list_xyh[i][2]
                break
        for i in range(n):
            if max(H - abs(cx - list_xyh[i][0]) - abs(cy - list_xyh[i][1]),0) == list_xyh[i][2]:
                continue
            else:
                break
        else:
            print(cx,cy,H)
            break
    else:
        continue
    break


Verdicts: Wrong Answer

Accepted
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):
n = int(input())
points = []
for i in range(n):
  x,y,h = map(int,input().split())
  if h == 0:
    continue
  points.append(list(x,y,h))
  

for k in range(len(points)):
　for l in range(k+1,len(points)):
　　for i in range(100):
　　　for j in range(100):
        if points[k][2] - points[l][2] == abs(points[l][0]-i) + abs(points[l][1]-j)- abs(points[k][0]-i)-abs(points[k][1]-j):
          

n = int(input())
hist = [tuple(map(int,input().split())) for _ in range(n)]
hist.sort(key=lambda x: x[2], reverse=1)

cands = []
x0,y0,h0 = hist[0]

for i in range(0,101):
  for j in range(0,101):
    if h0 == 0:
      cands.append((i,j,1))
    else:
      cands.append((i,j, h0+abs(i-x0)+abs(j-y0)))
    
for X,Y,H in cands:
  for x,y,h in hist:
    if max(H-abs(X-x)-abs(Y-y),0) == h:
      continue
    else:
      break
  else:
    print(X,Y,H)
    break
    



Verdicts: Runtime Error

Accepted
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):
def resolve():
    N = int(input())
    conds = [list(map(int, input().split(" "))) for i in range(N)]
    
    # [[cx, cy, H]]
    candidates = []

    first = sorted(conds, reverse=True, key=lambda x:x[2])[0]
    for cx in range(101):
        for cy in range(101):
            H = abs(first[0]-cx)+abs(first[1]-cy)+first[2]
            for n in range(1, N):
                cond = conds[n]
                if cond[2] == 0:
                    if abs(cond[0]-cx)+abs(cond[1]-cy) < cond[2]: 
                        ansflg = False
                        break
                else:
                    if abs(cond[0]-cand[0])+abs(cond[1]-cand[1])+cond[2] != H:
                        ansflg = False
                        break
            else:
                print("{} {} {}".format(cx, cy, H))
                exit()


if '__main__' == __name__:
    resolve()

def resolve():
    N = int(input())
    conds = [list(map(int, input().split(" "))) for i in range(N)]
    
    first = sorted(conds, reverse=True, key=lambda x:x[2])[0]
    for cx in range(101):
        for cy in range(101):
            H = abs(first[0]-cx)+abs(first[1]-cy)+first[2]
            for n in range(N):
                cond = conds[n]
                if cond[2] == 0:
                    if abs(cond[0]-cx)+abs(cond[1]-cy) < H: 
                        break
                elif abs(cond[0]-cx)+abs(cond[1]-cy)+cond[2] != H:
                    break
            else:
                print("{} {} {}".format(cx, cy, H))
                exit()


if '__main__' == __name__:
    resolve()

Verdicts: Runtime Error

Accepted
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):
N = int(input())
X = [0 for i in range(N)]
Y = [0 for i in range(N)]
H = [0 for i in range(N)]
tmp = []
for i in range(N):
    X[i], Y[i], H[i] = map(int, input().split())
for cx in range(0,101):
    for cy in range(0, 101):
        for i in range(N):
            if h != 0:
                ch = abs(X[i]-cx) + abs(Y[i]-cy) + H[i]
                tmp.add([cx, cy, ch])
for x, y, h in tmp:
    flag = True
    for i in range(N):
        if H[i] != max(h - abs(X[i]-x) - abs(Y[i]-y), 0)
            flag = False
            break
    if flag:
        print(x, y, h)
        break


N = int(input())
X = [0 for i in range(N)]
Y = [0 for i in range(N)]
H = [0 for i in range(N)]
tmp = []
for i in range(N):
    X[i], Y[i], H[i] = map(int, input().split())
for cx in range(0,101):
    for cy in range(0, 101):
        for i in range(N):
            if h != 0:
                ch = abs(X[i]-cx) + abs(Y[i]-cy) + H[i]
                tmp.add([cx, cy, ch])
for x, y, h in tmp:
    flag = True
    for i in range(N):
        if H[i] != max(h - abs(X[i]-cx) - abs(Y[i]-cy), 0)
            flag = False
            break
    if flag:
        print(x, y, h)
        break


N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]
ansx = 0
ansy = 0
ansh = 0
for x in range(101):
  for y in range(101):
    hset = set()
    for i in range(N):
      xyhi = xyh[i]
      if xyhi[2] == 0:
        continue
      hset.add(abs(xyhi[0]-x) + abs(xyhi[1]-y) + xyhi[2])

    if len(hset) == 1 and list(hset)[0] != 0:
      flag = True
      for i in range(N):
        xyhi = xyh[i]
        if xyhi[2] != 0:
          continue
        elif xyhi[2] == 0 and max(list(hset)[0] - abs(xyhi[0]-x) - abs(xyhi[1]-y), 0) == 0:
          continue
        flag = False
        break
      if flag:
        ansx = x
        ansy = y
        ansh = list(hset)[0]

print(ansx, ansy, ansh)



Verdicts: Runtime Error

Runtime Error

Accepted
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):
N = int(input())

X = [list(map(int, input().split())) for i in range(N)]

X.sort(key = lambda item: item[2] ,reverse = True)

for i in range(101):
    for j in range(101):
        h = X[0][2] + abs(X[0][0] - i) + abs(X[0][1] - j)
        
        ok = True
        for k in range(N):
            if X[0][2] != h - abs(X[k][0] - i) - abs(X[k][1] - j)
                ok = False
        
        if ok:
            print(i,j)
            exit()


N = int(input())

X = [list(map(int, input().split())) for i in range(N)]

X.sort(key = lambda item: item[2] ,reverse = True)

for i in range(101):
    for j in range(101):
        h = X[0][2] + abs(X[0][0] - i) + abs(X[0][1] - j)

        ok = True
        for k in range(N):
            if X[k][2] != max((h - abs(X[k][0] - i) - abs(X[k][1] - j)), 0):
                ok = False

        if ok:
            print(i, j, h)
            exit()



Verdicts: Runtime Error

Accepted
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):
n = int(input())
can = []
xyh = []
for _ in range(n):
  xyh.append(list(map(int,input().split())))
time = 0
while xyh[time][2] == 0:
  time += 1
x,y,h = xyh[time]
for i in range(101):
  for j in range(101):
    can.append([i, j, h + abs(x-i) + abs(y-j)])
step = 0
while len(can) != 1:
  x,y,h = xyh[(time + step) % n]
  if h != 0:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] != h + abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  else:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2]  < abs(x-now[0]) + abs(y-now[1]):
        del now
      else:
        cnt += 1
  step += 1
  if step == n:
    print('TLE')
print(' '.join(list(map(str,can[0]))))

n = int(input())
can = []
xyh = []
for _ in range(n):
  xyh.append(list(map(int,input().split())))
time = 0
while xyh[time][2] == 0:
  time += 1
x,y,h = xyh[time]
for i in range(101):
  for j in range(101):
    can.append([i, j, h + abs(x-i) + abs(y-j)])
step = 0
while len(can) != 1:
  x,y,h = xyh[(time + step) % n]
  if h != 0:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] != h + abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  else:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2]  < abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  step += 1
  if step == n:
    print('TLE')
print(' '.join(list(map(str,can[0]))))

n = int(input())
can = []
xyh = []
for _ in range(n):
  xyh.append(list(map(int,input().split())))
time = 0
while xyh[time][2] == 0:
  time += 1
x,y,h = xyh[time]
for i in range(101):
  for j in range(101):
    can.append([i, j, h + abs(x-i) + abs(y-j)])
step = 0
while len(can) != 1:
  x,y,h = xyh[(time + step) % n]
  if h != 0:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] != h + abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  else:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] > abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  step += 1
print(' '.join(list(map(str,can[0]))))

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):

N = int(input())

src = [tuple(map(int,input().split())) for i in range(N)]
 
INF = float('inf')

for cx in range(0,101):
    for cy in range(0,101):
        tmph = None
        maxh = INF
        for x,y,h in src:
            if h > 0:
                tmp = h + abs(x-cx) + abs(y-cy)
                if tmph is None:
                    tmph = tmp
                else:
                    if tmp != tmph:
                        break
#                 if tmph > maxh:
#                     break
            else:
                
                
                maxh = min(maxh, abs(x-cx) + abs(y-cy))
                
#                 if maxh == 1:
#                     tmph = 1
                 if tmph > maxh:
                    break
        else:
#             for x,y,h in src:
#                 if max(tmph - abs(x-cx) - abs(y-cy), 0) != h:
#                     break
#             else:
            print(cx,cy,tmph)
            exit()



N = int(input())

src = [tuple(map(int,input().split())) for i in range(N)]
 
INF = float('inf')

for cx in range(0,101):
    for cy in range(0,101):
        tmph = None
        maxh = INF
        for x,y,h in src:
            if h > 0:
                tmp = h + abs(x-cx) + abs(y-cy)
                if tmph is None:
                    tmph = tmp
                else:
                    
                    if tmp != tmph:
                        break
                if tmph > maxh:
                    break
            else:
                
                
                maxh = min(maxh, abs(x-cx) + abs(y-cy))
        else:
            for x,y,h in src:
                if max(tmph - abs(x-cx) - abs(y-cy), 0) != h:
                    break
            else:
                print(cx,cy,tmph)
                exit()

Verdicts: Runtime Error

Accepted
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):
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
n=int(input())
x,y,h=map(int,input().split())
d=set([(x,y,h)])
t=(x,y,h)
for i in range(n-1):
    x,y,h=map(int,input().split())
    d.add((x,y,h))

for i in range(101):
    for j in range(101):
        f=0
        p=abs(t[0]-i)+abs(t[1]-j)+t[2]
        for k in d:
            if p-(abs(k[0]-i)+abs(k[1]-j)+k[2])<0: f=1
            #if k[2]!=0 and abs(k[0]-i)+abs(k[1]-j)+k[2]!=p: f=1
            #if k[2]==0 and abs(k[0]-i)+abs(k[1]-j)+k[2]<p: f=1
        if f==0:
            print(i,j,p)
            exit()



n=int(input())
x,y,h=map(int,input().split())
d=set([(x,y,h)])
t=[x,y,h]
for i in range(n-1):
    x,y,h=map(int,input().split())
    d.add((x,y,h))
    if t[2]==0: t=[x,y,h]

for i in range(101):
    for j in range(101):
        f=0
        p=abs(t[0]-i)+abs(t[1]-j)+t[2]
        for k in d:
            if k[2]!=0 and abs(k[0]-i)+abs(k[1]-j)+k[2]!=p: f=1
            if k[2]==0 and abs(k[0]-i)+abs(k[1]-j)+k[2]<p: f=1
        if f==0:
            print(i,j,p)
            exit()

Verdicts: Wrong Answer

Accepted
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):
n = int(input())
xyh = [list(map(int,input().split())) for _ in [0]*n]
xyh = sorted(xyh,key=lambda x:x[2])
# H-|x-Cx|-|y-Cy| = h


for i in range(101):
  for j in range(101):
    Cx,Cy=i,j
    print(Cx,Cy)
    x,y,h = xyh[-1][0],xyh[-1][1],xyh[-1][2]
    H = max( h+ abs(x-Cx)+ abs(y-Cy), 0)
    if all([h==max(H-abs(x-Cx)-abs(y-Cy),0) for x,y,h in xyh]):
      print(Cx,Cy,H)
      exit()
        
        





n = int(input())
xyh = [list(map(int,input().split())) for _ in [0]*n]
xyh.sort(key=lambda x:x[2])
x0,y0,h0 = xyh[-1][0],xyh[-1][1],xyh[-1][2]


for Cx in range(101):
  for Cy in range(101):
    # H-|x-Cx|-|y-Cy| = h
    H = h0 + abs(x0-Cx) + abs(y0-Cy)
    tf = True
    for k in range(n-1):
      x,y,h = xyh[k][0], xyh[k][1], xyh[k][2]
      if h != max(H - abs(x-Cx) - abs(y-Cy), 0):
        tf = False
        break
    if tf == True and H >=1:
      print(Cx,Cy,H)
      exit()


Verdicts: Wrong Answer

Accepted
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):
n = int(input())
pyramid = [[int(x) for x in input().split()] for y in range(n)]
tmp_pyramid = [[{} for x in range(101)] for y in range(101)]

tmp_candidate = []
for i in range(101):
    for j in range(101):
        tmp_candidate = [max(0, h + abs(x-i) + abs(y-j)) for x, y, h in pyramid]
        set_candidate = set(tmp_candidate)
        if len(set_candidate) == 1:
            print(tmp_candidate)
            print(i, j, tmp_candidate[0])

n = int(input())
A = [[int(i) for i in input().split()] for i in range(n)]
A.sort(reverse = True, key = lambda x: x[2])

for i in range(101):
    for j in range(101):
        px, py, ph = A[0] 
        H = ph + abs(px - i) + abs(py - j)
        if all(h == max(H - abs(x - i) - abs(y - j) , 0) for x, y, h in A):
            print(i, j, H)

Verdicts: Wrong Answer

Accepted
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):
border = 101


def manhattan_distance(Cx, Cy, H, X, Y):
    return max(H - abs(X - Cx) - abs(Y - Cy), 0)


def judge_center(Cx, Cy, cords):
    for x, y, h in cords:
        if h > 0:
            H = abs(cords[0][0] - Cx) + abs(cords[0][1] - Cy) + cords[0][2]
            break
    for x, y, h in cords:
        tmp = manhattan_distance(Cx, Cy, H, x, y)
        if (h > 0 and H != tmp) or (h == 0 and H > tmp):
            return -1
    return H


def main():
    N = int(input())
    cords = [list(map(int, input().split(' '))) for _ in range(N)]

    for tmp_Cx in range(border):
        for tmp_Cy in range(border):
            h = judge_center(tmp_Cx, tmp_Cy, cords)
            if h != -1:
                print('{} {} {}'.format(tmp_Cx, tmp_Cy, h))
                return 0


if __name__ == '__main__':
    main()


border = 101


def manhattan_distance(Cx, Cy, H, X, Y):
    return max(H - abs(X - Cx) - abs(Y - Cy), 0)


def judge_center(Cx, Cy, cords):
    for x, y, h in cords:
        if h > 0:
            H = abs(x - Cx) + abs(y - Cy) + h
            break
    for x, y, h in cords:
        tmp = manhattan_distance(Cx, Cy, H, x, y)
        if h != tmp:
            return -1
    return H


def main():
    N = int(input())
    cords = [list(map(int, input().split(' '))) for _ in range(N)]

    for tmp_Cx in range(border):
        for tmp_Cy in range(border):
            h = judge_center(tmp_Cx, tmp_Cy, cords)
            if h != -1:
                print('{} {} {}'.format(tmp_Cx, tmp_Cy, h))
                return 0


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
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):
#!/usr/bin/env python3
import sys
{ % if prediction_success % }
{ % endif % }
{ % if mod or yes_str or no_str % }

{ % endif % }
{ % if mod % }
MOD = None  # type: int
{ % endif % }
{ % if yes_str % }
YES = "None"  # type: str
{ % endif % }
{ % if no_str % }
NO = "None"  # type: str
{ % endif % }
{ % if prediction_success % }


def main():
    N = int(input())
    points = []
    for _ in range(N):
        x, y, h = map(int, input().split())
        points.append((x, y, h))
        if h >= 1:
            hint = (x, y, h)

    for px in range(1, 101):
        for py in range(1, 101):
            H = hint[2] + abs(px-hint[0]) + abs(py-hint[1])
            clearflag = True
            for point in points:
                x, y, h = point
                val = max([H - abs(px-x) - abs(py-y), 0])
                if val != h:
                    clearflag = False

            if clearflag:
                print(px, py, H)
                return
if __name__ == '__main__':
    main()

def main():
    N = int(input())
    points = []
    for _ in range(N):
        x, y, h = map(int, input().split())
        points.append((x, y, h))
        if h >= 1:
            hint = (x, y, h)

    for px in range(101):
        for py in range(101):
            H = hint[2] + abs(px-hint[0]) + abs(py-hint[1])
            clearflag = True
            for point in points:
                x, y, h = point
                val = max([H - abs(px-x) - abs(py-y), 0])
                if val != h:
                    clearflag = False

            if clearflag:
                print(px, py, H)
                return
if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Accepted
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):
N = int(input())

x=[]
y=[]
h=[]

for i in range(N):
	x_i,y_i,h_i = list(map(int,input().split()))
	x.append(x_i)
	y.append(y_i)
	h.append(h_i)

s = "A"
s_max=20000
flag = 0
x_a=0
y_a=0
h_a=0

for C_X in range(101):
	for C_Y in range(101):
		for i in range(N):
			if h[i]!=0:
				if s=="A":
					s = abs(x[i]-C_X)+abs(y[i]-C_Y)+h[i]
					if s_max<s: break
					#print("%d %d %d set" % (C_X,C_Y,s))
				elif abs(x[i]-C_X)+abs(y[i]-C_Y)+h[i] != s:
					#print("%d %d %d failed" % (C_X,C_Y,s))
					s=0
					break
			else:
				if s=="A":
					if s_max==20000: s_max=abs(x[i]-C_X)+abs(y[i]-C_Y)
					elif abs(x[i]-C_X)+abs(y[i]-C_Y)<s_max: s_max=abs(x[i]-C_X)+abs(y[i]-C_Y)
				else:
					if abs(x[i]-C_X)+abs(y[i]-C_Y) < s:
						s="A"
						break
			if i==N-1:
				h_a=s
				flag=2
				break
		if flag:
			y_a=C_Y
			break
	if flag:
		x_a=C_X
		break

print("%d %d %d" % (x_a,y_a,h_a))

N = int(input())

x=[]
y=[]
h=[]

for i in range(N):
	x_i,y_i,h_i = list(map(int,input().split()))
	x.append(x_i)
	y.append(y_i)
	h.append(h_i)

s = 0
flag = 0
s_max=2000000000
x_a=0
y_a=0
h_a=0

for C_X in range(101):
	for C_Y in range(101):
		for i in range(N):
			if h[i]!=0:
				if s==0:
					s = abs(x[i]-C_X)+abs(y[i]-C_Y)+h[i]
					#print("%d %d %d set" % (C_X,C_Y,s))
				elif abs(x[i]-C_X)+abs(y[i]-C_Y)+h[i] != s:
					#print("%d %d %d failed" % (C_X,C_Y,s))
					s=0
					s_max=2000000000
					break
			else:
				if abs(x[i]-C_X)+abs(y[i]-C_Y) < s_max: s_max=abs(x[i]-C_X)+abs(y[i]-C_Y)
			if s_max < s:
				s=0
				s_max=2000000000
				break
			if i==N-1:
				h_a=s
				flag=2
				break
		if flag:
			y_a=C_Y
			break
	if flag:
		x_a=C_X
		break

print("%d %d %d" % (x_a,y_a,h_a))


Verdicts: Wrong Answer

Accepted
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):
for x in range(0,101):
    for y in range(0,101):
        h = -1
        for i in plist:
            diff = abs(i[0]-x) + abs(i[1]-y)
            if h == -1:
                h = diff + i[2]
            else:
                if h != diff + i[2]:
                    break
        else:
            print(x, y, h)

n = int(input())
plist = [tuple(map(int, input().split())) for i in range(n)]
plist = sorted(plist, key = lambda x: -x[2])

for x in range(0,101):
    for y in range(0,101):
        h = -1
        for i in plist:
            diff = abs(i[0]-x) + abs(i[1]-y)
            if h == -1:
                h = diff + i[2]
            elif i[2] == 0:
                if h > diff:
                    break
            else:
                if h != diff + i[2]:
                    break
        else:
            if h <= 0:
                pass
            else:
                print("{} {} {}".format(x, y, h))

Verdicts: Runtime Error

Accepted
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):
def main():
	n = int(input())
	xi, yi, hi = [0]*n, [0]*n, [0]*n
	stack = []
	result = []
	for i in range(n):
		xi[i], yi[i], hi[i] = map(int, input().split())
		if hi[i] > 0:
			stack = [xi[i], yi[i], hi[i]]
	for i in range(101):
		for j in range(101):
			guess = stack[2] + abs(stack[0]-i) + abs(stack[1]-j)
			is_result = True
			for k in range(n):
				result = guess - abs(xi[k]-i) - abs(yi[k]-j)
				result = max(result, 0)
				if hi[k] != result:
					is_result = False
					break
			if is_result:
				print(str(i)+" "+str(j)+" "+str(v))
				return


if __name__ == '__main__':
    main()

def main():
	n = int(input())
	xi, yi, hi = [0]*n, [0]*n, [0]*n
	stack = []
	result = []
	for i in range(n):
		xi[i], yi[i], hi[i] = map(int, input().split())
		if hi[i] > 0:
			stack = [xi[i], yi[i], hi[i]]
	for i in range(101):
		for j in range(101):
			guess = stack[2] + abs(stack[0]-i) + abs(stack[1]-j)
			is_result = True
			for k in range(n):
				result = guess - abs(xi[k]-i) - abs(yi[k]-j)
				result = max(result, 0)
				if hi[k] != result:
					is_result = False
					break
			if is_result:
				print(str(i)+" "+str(j)+" "+str(guess))
				return


if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Accepted
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):
n = int(input())
xyh = [list(map(int,input().split())) for _ in range(n)]

ans_x = 0
ans_y = 0
before = abs(0-xyh[0][0]) + abs(0-xyh[0][1]) + xyh[0][2]
cnt = 0
for cx in range(101):
    for cy in range(101):
        for x,y,h in xyh:
            height = abs(cx-x)+abs(cy-y)+h
            if height != before:
                break
            before = height
            cnt += 1
            if cnt == n:
                print(' '.join(map(str,[cx,cy,height])))
                exit()

n = int(input())
xyh = [list(map(int,input().split())) for _ in range(n)]

xyh.sort(key=lambda x: x[2], reverse=True)

before = 0
cnt = 0

for cx in range(101):
    for cy in range(101):
        for x,y,h in xyh:
            if cnt ==0:
                height = abs(cx-x)+abs(cy-y)+h
            
            if h != max(height-abs(cx-x)-abs(cy-y), 0):
                cnt = 0
                break

            cnt += 1
            if cnt == n:
                print(cx,cy,height)
                exit()

Verdicts: Wrong Answer

Accepted
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):
















import numpy as np
from itertools import product

N = int(input())
X, Y, H = [], [], []
for n in range(N):
    x, y, h = list(map(int, input().split()))
    # if h == 0:
    #     continue
    X.append(x)
    Y.append(y)
    H.append(h)

if N == 1:
    print(x, y, h)
    exit()

X = np.array(X)
Y = np.array(Y)
H = np.array(H)


def is_eq_loss(X, Y, H, a, b):
    loss = np.abs(H - np.abs(X - a) - np.abs(Y - b))
    mask = (H == 0)  
    loss[mask] = loss[mask].min()
    print(loss[-1])
    if (loss[-1] == loss).all():
        return True, loss[-1]
    else:
        return False, False


for a, b in product(range(101), range(101)):
    flg, ansH = is_eq_loss(X, Y, H, a, b)
    if flg:
        ans = (a, b, ansH)

print(*ans)



















import numpy as np
from itertools import product

N = int(input())
X, Y, H = [], [], []
for n in range(N):
    x, y, h = list(map(int, input().split()))
    if h == 0:
        continue
    X.append(x)
    Y.append(y)
    H.append(h)

if len(H) == 1:
    print(X[-1], Y[-1], H[-1])
    exit()

X = np.array(X)
Y = np.array(Y)
H = np.array(H)


def is_ok(X, Y, H, a, b):
    height = H + np.abs(X - a) + np.abs(Y - b)
    if (height == height[-1]).all():
        return True, height[-1]
    else:
        return False, False


for a, b in product(range(101), range(101)):
    flg, ansH = is_ok(X, Y, H, a, b)
    if flg:
        ans = (a, b, ansH)

print(*ans)


Verdicts: Runtime Error

Accepted