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())
xi,yi,hi=[],[],[]
for i in range(n):
    num=[int(j) for j in input().split()]
    xi+=[num[0]]
    yi+=[num[1]]
    hi+=[num[2]]
ans=[0,0,0]
for i in range(101):
    for j in range(101):
        hoge=0
        for k in range(n):
            hight=hi[k]+abs(xi[k]-(i))+abs(yi[k]-(j))
            if(k==0):
                hoge=hight
            elif(hoge!=hight):
                break
            else:
                hoge=hight
        else:
            ans=[i,j,hoge]
print(ans)

n=int(input())
xi,yi,hi=[],[],[]
for i in range(n):
    num=[int(j) for j in input().split()]
    xi+=[num[0]]
    yi+=[num[1]]
    hi+=[num[2]]
ans=[0,0,0]
for i in range(101):
    for j in range(101):
        hoge=10**9+10
        for k in range(n):
            hight=hi[k]+abs(xi[k]-i)+abs(yi[k]-j)
            if(hi[k]==0):
                continue
            if(i==xi[k] and j==yi[k]):
                hight=hi[k]
            if(hoge==10**9+10):
                hoge=hight
            elif(hoge!=hight):
                break
        else:
            flg=True
            for k in range(n):
                hight=max(hoge-abs(xi[k]-i)-abs(yi[k]-j),0)
                if(hi[k]!=hight):
                    flg=False
                    break
            if(flg):
                ans=[i,j,hoge]
print(*ans,sep=" ")

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=[[int(i) for i in input().split()] for i in range(n)]
#print(x)

def hight(a,b,x,y,z):
  h=z+abs(x-a)+abs(y-b)
  return h

ans=0

for k in range(101):
  for l in range(101):
    flag=0
    for i in range(1,n):
      if hight(k,l,x[-1][0],x[-1][1],x[-1][2])==hight(k,l,x[i][0],x[i][1],x[i][2]):
        flag+=1 
    if flag==n-1:
      ans1=k
      ans2=l
      ans3=hight(k,l,x[-1][0],x[-1][1],x[-1][2])

print(ans1,ans2,ans3)

n=int(input())

x=[[int(i) for i in input().split()] for i in range(n)]
#print(x)
for m in range(n):
  if x[m][2]>0:
    ii=m

def hight(a,b,x,y,z):
  h=z+abs(x-a)+abs(y-b)
  return h

ans=0

for k in range(101):
  for l in range(101):
    flag=0
    for i in range(1,n):
      if hight(k,l,x[ii][0],x[ii][1],x[ii][2])!=hight(k,l,x[i][0],x[i][1],x[i][2]) and x[i][2]>0:
        flag=1 
    if flag==0:
      ans1=k
      ans2=l
      ans3=hight(k,l,x[ii][0],x[ii][1],x[ii][2])

print(ans1,ans2,ans3)

n=int(input())

x=[[int(i) for i in input().split()] for i in range(n)]
#print(x)
cnt=0
for m in range(n):
  if x[m][2]>0:
    cnt+=1
    ii=m
    
#print(ii,cnt)

def hight(a,b,x,y,z):
  h=z+abs(x-a)+abs(y-b)
  return h

for i in range(101):
  for j in range(101):
    flag=0
    for k in range(n):
      if x[k][2]>0:
        if hight(i,j,x[ii][0],x[ii][1],x[ii][2])==hight(i,j,x[k][0],x[k][1],x[k][2]):
          flag+=1
      else:
        if hight(i,j,x[ii][0],x[ii][1],x[ii][2]) > hight(i,j,x[k][0],x[k][1],x[k][2]):
          flag=0
     
    if flag==cnt:
      ans1=i
      ans2=j
      ans3=hight(i,j,x[ii][0],x[ii][1],x[ii][2])
      
print(ans1,ans2,ans3)
#print(flag)

Verdicts: Runtime Error

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())
xx = [0] * n
yy = [0] * n
hh = [0] * n
for i in range(n):
    x, y, h = map(int, input().split())
    xx[i], yy[i], hh[i] = x, y, h
    if h > 0:
        x0, y0, h0 = x, y, h
print([x0, y0, h0])

for cx in range(101):
    for cy in range(101):
        f = True
        h = h0 + abs(x0 - cx) + abs(y0 - cy)
        for i in range(n):
            if hh[i] != max(h - abs(xx[i] - cx) - abs(yy[i] - cy), 0):
                f = False
                break
        if f:
            print("{} {} {}".format(cx, cy, h))
            exit(0)


n = int(input())
xx = [0] * n
yy = [0] * n
hh = [0] * n
for i in range(n):
    x, y, h = map(int, input().split())
    xx[i], yy[i], hh[i] = x, y, h
    if h > 0:
        x0, y0, h0 = x, y, h

for cx in range(101):
    for cy in range(101):
        f = True
        h = h0 + abs(x0 - cx) + abs(y0 - cy)
        for i in range(n):
            if hh[i] != max(h - abs(xx[i] - cx) - abs(yy[i] - cy), 0):
                f = False
                break
        if f:
            print("{} {} {}".format(cx, cy, h))
            exit(0)


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())
surveys = [list(map(int, input().split())) for _ in range(N)]
for x in range(101):
  for y in range(101):
    before = 0
    identified = True
    for survey in surveys:
      height = survey[2] + abs(x-survey[0]) + abs(y-survey[1])
      if height != 0 and before != height:
        identified = False
        continue
      if height != 0:
        before = height
    if identified:
      print(x, y, before)


N = int(input())
surveys = [list(map(int, input().split())) for _ in range(N)]
surveys.sort(key = lambda x:-x[2])
for x in range(101):
  for y in range(101):
    before = -1
    identified = True
    for survey in surveys:
      height = survey[2] + abs(x-survey[0]) + abs(y-survey[1])
      if before != -1 and before != height:
        if survey[2] == 0 and before < height:
          continue
        identified = False
        break
      if before == -1:
        before = height
    if identified:
      print(x, y, before)
      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())
x = {}
y = {}
h = {}
for i in range(N):
  x[i], y[i], h[i] = map(int, input().split())
  if h[i] != 0:
    x0, y0, h0 = x[i], y[i], h[i]
    break
for cx in range(101):
  for cy in range(101):
    H = h0 + abs(cx - x0) + abs(cy - y0)
    for i in range(N):
      if max(H - abs(x[i] - cx) - abs(y[i] - cy), 0) != h[i]:
        break
    else:
      print(cx, cy, H)
      break
    continue
  else:
    continue
  break


N = int(input())
x = {}
y = {}
h = {}
for i in range(N):
  x[i], y[i], h[i] = map(int, input().split())
  if h[i] != 0:
    x0, y0, h0 = x[i], y[i], h[i]
for cx in range(101):
  for cy in range(101):
    H = h0 + abs(cx - x0) + abs(cy - y0)
    for i in range(N):
      if max(H - abs(x[i] - cx) - abs(y[i] - cy), 0) != h[i]:
        break
    else:
      print(cx, cy, H)
      break
    continue
  else:
    continue
  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):
	h.append(xyh[2])

for i in range(101):
	for j in range(101):
		for k in range(n):
			if h[k] != 0:
				height = abs(i-x[k]) + abs(j-y[k]) + h[k]
				break
			
		flag = 0
		for k in range(n):
			if h[k] != max(height- abs(i-x[k]) - abs(j-y[k]) , 0):
				flag = 1
				break
			
		if flag == 0:
			ans = [i,j,height]
			break
		
	
print('{0} {1} {2}'.format(ans[0], ans[1], ans[2]))

n = int(input())
x = []
y = []
h = []
ans = [0,0,0]
for i in range(n):
	xyh = list(map(int, input().split()))
	x.append(xyh[0])
	y.append(xyh[1])
	h.append(xyh[2])

for i in range(101):
	for j in range(101):
		for k in range(n):
			if h[k] != 0:
				height = abs(i-x[k]) + abs(j-y[k]) + h[k]
				break
			
		flag = 0
		for k in range(n):
			if h[k] != max(height- abs(i-x[k]) - abs(j-y[k]) , 0):
				flag = 1
				break
			
		if flag == 0:
			ans = [i,j,height]
			break
		
	
print('{0} {1} {2}'.format(ans[0], ans[1], ans[2]))

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 = [list(map(int, input().split()))for _ in range(n)]
ax=x[0][0]
ay=x[0][1]
ah=x[0][2]
for x in range(101):
    for y in range(101):
        H = ah+abs(ax-x)+abs(ay-y)
        if all(max(H-abs(t[0]-x)-abs(t[1]-y), 0) == t[2]for t in p):
            print(x, y, H)


N=int(input())
p=[list(map(int, input().split())) for _ in range(N)]
ax, ay, ah = list(filter(lambda x: x[2], p))[0]
for i in range(101):
  for j in range(101):
    center=[i,j,ah+abs(ax-i)+abs(ay-j)]
    if all(t[2]==max(center[2]-abs(t[0]-center[0])-abs(t[1]-center[1]),0) for t in x) :
      print(center[0],center[1],center[2])


N = int(input())
x = [list(map(int, input().split()))for _ in range(N)]
ax=x[0][0]
ay=x[0][1]
ah=x[0][2]
for x in range(101):
    for y in range(101):
        H = ah+abs(ax-x)+abs(ay-y)
        if all(max(H-abs(t[0]-x)-abs(t[1]-y), 0) == t[2]for t in p):
            print(x, y, H)


N=int(input())
p=[list(map(int, input().split())) for _ in range(N)]
ax, ay, ah = list(filter(lambda x: x[2], p))[0]
for i in range(101):
  for j in range(101):
    center=[i,j,ah+abs(ax-i)+abs(ay-j)]
    if all(t[2]==max(center[2]-abs(t[0]-center[0])-abs(t[1]-center[1]),0) for t in p) :
      print(center[0],center[1],center[2])

Verdicts: Runtime Error

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())
xyh = [tuple(map(int, input().split())) for i in range(n)]
print(xyh)

for cx in range(101):
    for cy in range(101):
        height = set(hi + abs(xi-cx) + abs(yi-cy) for xi, yi, hi in xyh if hi > 0)
        print(height)
        if len(height) == 1:
            H = max(height)
            if all(set(hi=max(H - abs(xi-cx) - abs(yi-cy), 0)) for xi, yi, hi in xyh if hi == 0):
                print(cx, cy, H)
                exit()

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

for cx in range(101):
    for cy in range(101):
        height = set(hi + abs(xi-cx) + abs(yi-cy) for xi, yi, hi in xyh if hi > 0)
        if len(height) == 1:
            H = max(height)
            if all(set(hi==max(H - abs(xi-cx) - abs(yi-cy), 0) for xi, yi, hi in xyh if hi == 0)):
                print(cx, cy, 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):
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    points = reversed(
        [[int(i) for i in input().split()] for _ in range(n)],
        key=lambda x: x[2],
        reverse=True,
    )
    print(points)
    hoge = 101
    for cx in range(hoge):
        for cy in range(hoge):
            x, y, z = points[0]
            h = max(z + abs(x - cx) + abs(y - cy), 0)
            
            if h == 0:
                continue
            if all(
                [h == max(z + abs(x - cx) + abs(y - cy), 0) for x, y, z in points[1:]]
            ):
                print(cx, cy, h)
                break


if __name__ == "__main__":
    main()


import sys

input = sys.stdin.readline


def main():
    n = int(input())
    points = sorted(
        [[int(i) for i in input().split()] for _ in range(n)],
        key=lambda x: x[2],
        reverse=True,
    )
    print(points)
    hoge = 101
    for cx in range(hoge):
        for cy in range(hoge):
            x, y, z = points[0]
            h = max(z + abs(x - cx) + abs(y - cy), 0)
            
            if h == 0:
                continue
            if all(
                [h == max(z + abs(x - cx) + abs(y - cy), 0) for x, y, z in points[1:]]
            ):
                print(cx, cy, h)
                break


if __name__ == "__main__":
    main()


import sys

input = sys.stdin.readline


def main():
    n = int(input())
    points = sorted(
        [[int(i) for i in input().split()] for _ in range(n)],
        key=lambda x: x[2],
        reverse=True,
    )
    hoge = 101
    for cx in range(hoge):
        for cy in range(hoge):
            x, y, z = points[0]
            h = z + abs(x - cx) + abs(y - cy)

            if h < 1:
                continue
            if all([z == max(h - abs(x - cx) - abs(y - cy), 0) for x, y, z in points]):
                print(cx, cy, h)
                return


if __name__ == "__main__":
    main()


Verdicts: Runtime Error

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


def isvalid(i, j):
    p, q, h = query[0]
    H = h + abs(p - i) + abs(q - j)
    if H < 1:
        return -1
    for que in query[1:]:
        p, q, h = que
        if h != max(H - abs(p - i) - abs(q - j)):
            return -1
    return H


for i in range(101):
    for j in range(101):
        H = isvalid(i, j)
        if H != -1:
            print(i, j, H)
            exit()

           

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


def isvalid(i, j):
    H = -1
    for p, q, h in query:
        if h != 0:
            H = h + abs(p - i) + abs(q - j)
            break

    for p, q, h in query:
        if H == -1 and h != 0:
            H = h + abs(p - i) + abs(q - j)

        if h != max(H - abs(p - i) - abs(q - j), 0):
            return -1
    return H


for i in range(101):
    for j in range(101):
        H = isvalid(i, j)
        if H >= 1:
            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):
# -*- coding: utf-8 -*-

def main():
    N  = int(input())
    points = [input() for i in range(N)]

    T = -10000000

    for x in range(101):
        for y in range(101):
            for i,p in enumerate(points):
                p = [int(j) for j in p.split()]
                distance = abs(x-p[0]) + abs(y-p[1]) + p[2]
                if p[2] == 0:
                    if i == N-1:
                        print(x, y , T)
                        return
                    else:
                        continue                    


                if T==-10000000:
                    T=distance
                elif T == distance:
                    if i == N-1:
                        print(x, y , T)
                        return
                    continue
                else:
                    T = -1
                    break

if __name__ == "__main__":
    main()


# -*- coding: utf-8 -*-

def main():
    N  = int(input())
    P = []
    for i in range(N):
        x, y, h = map(int, input().split())
        P.append([h, x, y])
    P.sort(reverse = True)

    for x in range(101):
        for y in range(101):
            distance =abs(x-P[0][1]) + abs(y-P[0][2]) + P[0][0]
            for p in P[1:]:
                if max(distance - abs(x-p[1]) - abs(y-p[2]), 0) !=  p[0]:
                    break
            else:
                print(x, y , distance)
                return

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):
import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    points = list(map(string_to_int, inputs))
    for top_x in range(101):
        for top_y in range(101):
            prev_h = -1
            is_correct = True
            for [px, py, ph] in points:
                if ph == 0:
                    continue
                top_h = ph + abs(px - top_x) + abs(py - top_y)
                if prev_h == -1 or top_h == prev_h:
                    prev_h = top_h
                else:
                    is_correct = False
                    break
            if is_correct:
                return "{} {} {}".format(top_x, top_y, prev_h)

import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    points = list(map(string_to_int, inputs))
    points = [p for p in points if p[2] != 0]
    if len(points) == 1:
        return "{} {} {}".format(points[0][0], points[0][1], points[0][2])
    for top_x in range(101):
        for top_y in range(101):
            is_correct = True
            p = points[0]
            prev_h = max(p[2] + abs(p[0] - top_x) + abs(p[1] - top_y), 0)
            for [px, py, ph] in points:
                top_h = max(ph + abs(px - top_x) + abs(py - top_y), 0)
                if top_h != prev_h:
                    is_correct = False
                    break
            if is_correct:
                return "{} {} {}".format(top_x, top_y, prev_h)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(inputs(N))
    print(ret)


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 sys

N = int(input())
xyh = []
for _ in range(N):
    x, y, h = map(int, input().split())
    xyh.append(tuple(x, y, h))

for X in range(101):
    for Y in range(101):
        flag = True
        H = 0
        for cx, cy, ch in xyh:
            if ch != 0:
                H = ch + abs(X - cx) + abs(Y - cy)
        for cx, cy, ch in xyh:
            h  max(h - abs(X - cx) - abs(Y - cy), 0)
            if ch != h:
                flag = False

        if flag:
            print(X, Y, H)
            sys.exit(0)


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

for i in c:
    if i[2] > 0:
        o = i
        break

for cx in range(101):
    for cy in range(101):
        H = o[2] + abs(o[0] - cx) + abs(o[1] - cy)
        f = True
        for i in c:
            x, y, h = i[0], i[1], i[2]
            if h != max(0, H - abs(x - cx) - abs(y - cy)):
                f = False
                break
        if f:
            print(cx, cy, 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())
x = []
y = []
h = []
for i in range(n):
    a,b,c = map(int, input().split())
    x.append(a)
    y.append(b)
    h.append(c)
for i in range(101):
    for j in range(101):
        check = []
        check2 = True
        for k in range(n):
            H = h[k] + abs(x[k] - i) + abs(y[k] - j)
            if h[k] > 0:
                if H != abs(x[k]-i)+abs(y[k]-j)+h[k]:
                    H = -1
            if h[k] == 0:
                if H > abs(x[k] - i) + abs(y[k] - j):
                    H = -1
        if H != -1:
            print(i, j, H)

n = int(input())
x = []
y = []
h = []
for i in range(n):
    a,b,c = map(int, input().split())
    x.append(a)
    y.append(b)
    h.append(c)
kk = h.index(max(h))
for i in range(101):
    for j in range(101):
        H = h[kk] + abs(x[k] - i) + abs(y[k] - j)
        for k in range(n):
            if h[k] > 0:
                if H != abs(x[k]-i)+abs(y[k]-j)+h[k]:
                    H = -1
            if h[k] == 0:
                if H > abs(x[k] - i) + abs(y[k] - j):
                    H = -1
        if H != -1:
            print(i, j, H)

n = int(input())
x = []
y = []
h = []
for i in range(n):
    a,b,c = map(int, input().split())
    x.append(a)
    y.append(b)
    h.append(c)
    
index = h.index(max(h))
for cx in range(101):
    for cy in range(101):
        H = h[index] + abs(x[index] - cx) + abs(y[index] - cy)
        flag = True
        for i in range(n):
            if h[i] > 0:
                if H != (h[i] + abs(x[i] - cx) + abs(y[i] - cy)):
                    flag = False
            if h[i] == 0:
                if (H -  abs(x[i] - cx) - abs(y[i] - cy)) > 0:
                    flag = False
        if flag:
            print(cx,cy,H)

Verdicts: Wrong Answer

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())

clues = [tuple(map(int, input().split())) 
         for _i in range(n)]
good_clue = next(clue for clue in clues if clue[2] > 0)

centers = [(x, y) 
           for x in range(101) 
           for y in range(101)]
for cx, cy in centers:
    ch = good_clue[2] \
         + abs(good_clue[0] - cx) \
         + abs(good_clue[1] - cy)

    if all(h != max(ch - abs(x - cx) - abs(y - cy), 0) 
           for x, y, h in clues):
        print(cx, cy, ch)
        break

n = int(input())

clues = [tuple(map(int, input().split()))
         for _i in range(n)]
good_clue = next(clue for clue in clues if clue[2] > 0)

centers = [(x, y)
           for x in range(101)
           for y in range(101)]
for cx, cy in centers:
    ch = good_clue[2] \
         + abs(good_clue[0] - cx) \
         + abs(good_clue[1] - cy)

    if all(h == max(ch - abs(x - cx) - abs(y - cy), 0)
           for x, y, h in clues):
        print(cx, cy, ch)
        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())

A=[]
for i in range(N):
    a, b, c = map(int, input().split())
    A.append([a, b, c])

A.sort(key=lambda x:-x[2])

for x in range(0, 101):
    for y in range(0, 101):
        H = A[0][2]+abs(A[0][0]-x)+abs(A[0][1]-y)
        Flag = True
        for i in range(1, N):
            if A[i][2] > 0:
                    if H != A[i][2]+abs(A[i][0]-x)+abs(A[i][1]-y):
                        Flag = False
                        break
            else:
                if H > abs(A[i][0]-x)+abs(A[i][1]-y):
                    Flag = False
                    break
        if Flag == True:
            print(x, y, h)

N = int(input())

A=[]
for i in range(N):
    a, b, c = map(int, input().split())
    A.append([a, b, c])

A.sort(key=lambda x:-x[2])

for x in range(0, 101):
    for y in range(0, 101):
        H = A[0][2]+abs(A[0][0]-x)+abs(A[0][1]-y)
        Flag = True
        for i in range(1, N):
            if A[i][2] != 0:
                    if H != A[i][2]+abs(A[i][0]-x)+abs(A[i][1]-y):
                        Flag = False
                        break
            else:
                if H > abs(A[i][0]-x)+abs(A[i][1]-y):
                    Flag = False
                    break
        if Flag == True:
            print(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):



N = int(input())
C = []

for i in range(N):
  x, y, z = map(int, input().split())
  C.append((x, y, z))

for X in range(101):
  for Y in range(101):

    hs = set()

    for i in range(N):
      x, y, h = map(int, C[i])
      if h > 0:
        hs.add(abs(x-X) + abs(y-Y) + h)
      if i == N - 1 and len(hs) <= 0:
        if len(hs) == 1 or 0 in hs:
          print(X, Y, abs(x-X) + abs(y-Y) + h)



N = int(input())

P = []

for i in range(N):
  x, y, h = map(int, input().split())
  P.append((x,y,h))

for x in range(101):
  for y in range(101):
    height = -1
    for p in range(N):
      (cx, cy, ch) = P[p]
      if height == -1:
        height = ch + abs(cx - x) + abs(cy - y)
        if height < 1:
          height = -1
      elif height == -2:
        break
      else:
        tmp = ch + abs(cx - x) + abs(cy - y)
        if tmp != height:
          height = -2
    
    if height != -2:
      valid = True
      for p in range(N):
        (cx, cy, ch) = P[p]
        if ch == 0:
          if height - abs(cx - x) - abs(cy - y) > 0:
            valid = False
        else
          if max(0, height - abs(cx - x) - abs(cy - y)) != ch:
            valid = False
      if valid:
        print(x, y, height)
        exit()



N = int(input())

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

for cx in range(101):
  for cy in range(101):

    for i in range(N):
      x, y, h = map(int, edges[i])
      if h > 0:
        htop = abs(x-cx) + abs(y-cy) + h

    for i in range(N):
      x, y, h = map(int, edges[i])
      if h == 0:
        if htop - (abs(x-cx) + abs(y-cy)) > 0:
          break
      if h > 0:
        if htop - (abs(x-cx) + abs(y-cy)) != h:
          break
    else:
      print(cx, cy, htop)
      exit()

Verdicts: Wrong Answer

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())
v=[[int(_) for _ in input().split()] for l in range(n)]
v.sort(key=lambda x:x[2])

print(v)

s=set()

def detect():
  for x in range(101):
    for y in range(101):
      for i in range(n):
        s.add(abs(v[i][0]-x)+abs(v[i][1]-y)+v[i][2])
      if len(s)==1:
        print(x,y,v[0][2]+abs(v[0][0]-x)+abs(v[0][1]-y))
        return
      else:
        s.clear()

detect()


n=int(input())
v=[[int(_) for _ in input().split()] for l in range(n)]

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

points = []
for i in range(0, N):
    xi, yi, hi = map(int, input().split())
    points.append((xi, yi, hi))

cand = {}
for CX in range(101):
    for CY in range(101):
        Hs = set()
        for x, y, h in points:
            H = h + abs(x - CX) + abs(y - CY)
            Hs.add(H)
        if len(Hs) == 1:
            cand[H] = (CX, CY, H)


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

for Cx in range(101):
    for Cy in range(101):
        H = None
        for xi, yi, hi in points:
            dx = abs(xi - Cx)
            dy = abs(yi - Cy)
            if hi > 0:
                
                H_calc = hi + dx + dy
                if H is None:
                    H = H_calc
                elif H != H_calc:
                    H = None
                    break  
            else:
                
                if H > dx + dy:
                    H = None
                    break  

        if H:
            print('{} {} {}'.format(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):
import sys
N = int(input().strip())
grid = []
ref = 0
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
    if array[2]>0:
      ref = i
x = 0
y = 0
while y <= 100:
  x = 0
  while x <= 100:
    h0 = grid[ref][2]+abs(x-grid[ref][0])+abs(y-grid[ref][1])
    for arrays in grid:
      h = h0-abs(x-arrays[0])-abs(y-arrays[1])
      if h != arrays[2]:
        break
    print(x,y,h0)
      sys.exit()
    x += 1
  y += 1

import sys
N = int(input().strip())
grid = []
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
x = 0
y = 0
while y <= 100:
  x = 0
  while x <= 100:
    lis = []
    for arrays in grid:
      if arrays[2]>=1:
        lis.append(arrays[2]+abs(x-arrays[0])+abs(y-arrays[1]))
    if min(lis)==max(lis):
      if print(x,y,max(0,arrays[2]+abs(x-arrays[0])+abs(y-arrays[1])))
      sys.exit()
    x += 1
  y += 1
        


import sys
N = int(input().strip())
grid = []
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
x = 0
y = 0
while y <= 100:
  while x <= 100:
    lis = []
    for arrays in grid:
      lis.append(arrays[2]+abs(x-arrays[0])+abs(y-arrays[1]))
    if min(lis)==max(lis):
      print(x,y,arrays[2]+abs(x-arrays[0])+abs(y-arrays[1]))
      sys.exit()
    x += 1
  y += 1
        


import sys
N = int(input().strip())
grid = []
ref = 0
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
    if array[2]>0:
      ref = i
x = 0
y = 0
while y <= 100:
  x = 0
  while x <= 100:
    flag = 0
    h0 = grid[ref][2]+abs(x-grid[ref][0])+abs(y-grid[ref][1])
    for arrays in grid:
      h = max(0,h0-abs(x-arrays[0])-abs(y-arrays[1]))
      if h != arrays[2]:
        flag = 1
    if flag == 0:
      print(x,y,h0)
      sys.exit()
    x += 1
  y += 1

Verdicts: Runtime Error

Runtime Error

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 i in range(N)]

for Cx in range(55, 101):
    for Cy in range(80,101):
        criteria = -1
        for x, y, h in xyh:
            if h == 0:
                continue
            H = h + abs(x - Cx) + abs(y - Cy)
            if H == criteria or criteria == -1:
                criteria = H
                continue
            else:
                break
        else:
            print(Cx, Cy, criteria)


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

for Cx in range(101):
    for Cy in range(101):
        criteria = -1
        ax, ay, ah = 0, 0, 0
        cnt = 0
        for x, y, h in xyh:
            if h == 0:
                continue
            H = h + abs(x - Cx) + abs(y - Cy)
            if H == criteria or criteria == -1:
                criteria = H
                ax, ay, ah = x, y, h
                cnt += 1
                continue
            else:
                break
        else:
            if cnt == 1:
                print(ax, ay, ah)
                exit()
            else:
                print(Cx, Cy, criteria)


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 = []
y = []
h = []
for i in range(n):
    tmp_list = [int(i) for i in input().split()]
    x.append(tmp_list[0])
    y.append(tmp_list[1])
    h.append(tmp_list[2])

print(x, y, h)
H = -1
cx = -1
cy = -1

for x_i in x:
    if x_i is 0:
        cx = 0

for y_i in y:
    if y_i is 0:
        cy = 0

for i in range(0, 100):
    for j in range(0, 100):
        h_tmp = h[0] + (x[0] - i) + (y[0] - j)
        if h_tmp is h[1] + (x[1] - i) + (y[1] - j) and h_tmp > 0:
            cx, cy = i, j
            H = h_tmp

print('{} {} {}'.format(cx, cy, H))


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

for cx in range(101):
    for cy in range(101):
        needH = -1

        for x, y, h in xyh:
            if h > 0:
                
                tmp = h + abs(cx - x) + abs(cy - y)
                if needH == -1:
                    needH = tmp
                else:
                    if needH != tmp:
                        needH = -2
                        break

        if needH == -2:
            continue

        for x, y, h, in xyh:
            if h == 0:
                dist = abs(cx - x) + abs(cy - y)
                if needH - dist > 0:
                    needH = -2
                    break
        if needH == -2:
            continue

        print(cx, cy, needH)
        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):
# -*- coding: utf-8 -*-
#ABC112C
import sys

n = int(input())

x = []
y = []
h = []
for i in range(0,n):
	tmp = input().split()
	hoge = list(map(lambda a: int(a), tmp))
	x.append(hoge[0])
	y.append(hoge[1])
	h.append(hoge[2])

distance=0
height=0
#peak ga (i,j) to katei
for i in range(0,101):
	for j in range(0,101):
		distance=abs(i-x[0])
		distance+=abs(j-y[0])
		height=distance+h[0]

		for k in range(1,n):
			distance=abs(i-x[k])
			distance+=abs(j-y[k])
			if(height==distance+h[k]!):
				break
			if(k==n-1):
				print(i,j,height)
				sys.exit()

# -*- coding: utf-8 -*-
#ABC112C
import sys

n = int(input())

x = []
y = []
h = []
for i in range(0,n):
	tmp = input().split()
	hoge = list(map(lambda a: int(a), tmp))
	x.append(hoge[0])
	y.append(hoge[1])
	h.append(hoge[2])

distance=0
height=0

m=0
while(h[m]==0):
	m+=1
for i in range(0,101):
	for j in range(0,101):
		distance=abs(i-x[m])
		distance+=abs(j-y[m])
		height=distance+h[m]
		for k in range(0,n):
			distance=abs(i-x[k])
			distance+=abs(j-y[k])
			if(max(height-distance,0)!=h[k]):
				break
			if(k==n-1):
				print(i,j,height)
				sys.exit()

Verdicts: Runtime Error

Accepted