Problem: There are N points on the 2D plane, i-th of which is located on (x_i, y_i). There can be multiple points that share the same coordinate. What is the maximum possible Manhattan distance between two distinct points?  Here, the _Manhattan distance_ between two points (x_i, y_i) and (x_j, y_j) is defined by |x_i-x_j| + |y_i-y_j|.

Submission attempts (in order):
import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline



def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]
    print(-1)

    xy = np.array(xy)
    # print(xy)

    diffs = xy - xy.T
    print(-1)
    md = np.sum(np.abs(diffs),axis=-1)
    res = md.max()

    # print(diffs)
    # print(md)

    print(res)



main()


import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline



def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]

    xy = np.array(xy)
    # print(xy)

    diffs = xy - xy.T
    print(-1)
    md = np.sum(np.abs(diffs),axis=-1)
    res = md.max()

    # print(diffs)
    # print(md)

    print(res)



main()


import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline



def main():
    N = int(input())
    print(-1)
    xy = [list(map(int,input().split())) for i in range(N)]
    print(-1)

    xy = np.array(xy)
    # print(xy)

    diffs = xy - xy.T
    print(-1)
    md = np.sum(np.abs(diffs),axis=-1)
    res = md.max()

    # print(diffs)
    # print(md)

    print(res)



main()


import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline

from scipy.spatial import distance


def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]

    xy = np.array(xy)

    md = distance.cdist(xy, xy, metric='minkowski', p=1)


    print(0)



main()


import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline

from scipy.spatial import distance


def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]

    xy = np.array(xy)

    print(0)



main()


import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline



def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]

    xy = np.array(xy)
    # print(xy)

    diffs = xy - xy.T
    md = np.sum(np.abs(diffs),axis=-1)
    res = md.max()

    # print(diffs)
    # print(md)

    print(res)



main()


import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline



def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]

    z_max = 0
    z_min = 2 * 10 **9

    w_max = - 10 ** 9
    w_min = 10 ** 9

    for i in range(N):
        z = xy[i][0] + xy[i][1]
        w = xy[i][0] - xy[i][1]
        z_max = max(z_max,z)
        z_min = min(z_min,z)
        w_max = max(w_max,w)
        w_min = min(w_min,w)

    res = max(z_max-z_min,w_max-w_min)

    print(res)



main()


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted