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())
coords = [tuple(map(int, input().split())) for i in range(n)]
left, right, top, down = 0, 100, 0, 100
iplusj = -1
H = -1
for i in range(n):
    x1, y1, h1 = coords[i]
    for j in range(i+1, n):
        x2, y2, h2 = coords[j]
        if h2-h1< 0:
            h2, x2, y2, h1, x1, y1 = h1, x1, y1, h2, x2, y2
        if h1 == 0 or h2 == 0:
            continue
        dx = x2 - x1
        dy = y2 - y1
        dh = h2 - h1
        print (left, right, x1, x2)
        if abs(dh) < abs(dx) + abs(dy):
            d = (abs(dx) + abs(dy) - abs(dh))//2 
            if H < max(h1, h2) + d:
                #print (x1, y1, h1, x2, y2, h2, d)
                H = max(h1, h2) + d
                if dx > 0 or dy > 0:
                    iplusj = x2-d+y2
                elif dx < 0 or dy < 0:
                    iplusj = x2+d+y2
            """
            if dx > 0:
                left = max(x1, left)
                right = min(x2, right)
            elif dx < 0:
                left = max(x2, left)
                right = min(x1, right)
            if dy > 0:
                top = max(y1, top)
                down = min(y2, down)
            elif dy < 0:
                top = max(y2, top)
                down = min(y1, down)
            """
        else:
            #print (h1, x1, y1, h2, x2, y2)
            if dx > 0:
                left = max(x1, left)
                right = min(x2, right)
            elif dx < 0:
                left = max(x2, left)
                right = min(x1, right)
            if dy > 0:
                top = max(y1, top)
                down = min(y2, down)
            elif dy < 0:
                top = max(y2, top)
                down = min(y1, down)
print ("iplusj", left, right, top, down, iplusj, H)
if iplusj == -1:
    no1 = max(coords, key=lambda x: x[2])
    x, y, H = no1
    print (x, y, H)
else:
    for y in range(101):
        x = iplusj - y
        if x < 0:
            continue
        success = True
        for i in range(n):
            x1, y1, h1 = coords[i]
            if h1 == 0:
                continue
            dx, dy = x-x1, y-y1
            
            if (h1 + abs(dx)+abs(dy) != H):
                success = False
                break
        if success:
            print (x, y, H)
            break

n = int(input())
coords = [tuple(map(int, input().split())) for i in range(n)]
for xt, yt, ht in coords:
    if ht != 0:
        break
x, y, h = -1, -1, -1
for px in range(101):
    for py in range(101):
        flag = True
        htmp = ht + abs(px-xt) + abs(py-yt)
        dxdy = [(abs(px-x1)+abs(py-y1), htmp-h1) for x1, y1, h1 in coords]
        dxdy.sort()
        for i in range(n-1):
            if dxdy[i][0] < dxdy[i+1][0] and dxdy[i][1] > dxdy[i+1][1]:
                flag = False
                break
        for x1, y1, h1 in coords:
            #print (px, py, htmp, x1, y1, h1)
            if h1 == 0:
                continue
            if abs(htmp-h1) != abs(px-x1) + abs(py-y1):
                flag = False
                break
        if flag:
            if htmp > h:
                h = htmp
                x = px
                y = py
print (x, y, h)

Verdicts: Wrong Answer

Accepted