Buggy python submission (verdict: Runtime Error):
h, w, m = map(int, input().split())

# l = np.array([0]*(h*w))
l = [0]*(h*w)

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))

    l[(h_input-1)*w:(h_input-1)*w+w] = list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)*w+w]))

    # l = list(map(lambda a,b: x + z, x,y))
#     l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] =  list(map(lambda x: x+1, l[w_input-1::w]))
    l[(h_input-1)*w+w_input-1] -= 1
print(max(l))
 


Fixed submission:
h, w, m = map(int, input().split())

h_bomb = [0 for i in range(h)]
w_bomb = [0 for i in range(w)]
bomb_list = []

for i in range(m):
    hb, wb = map(int, input().split())
    h_bomb[hb-1] += 1
    w_bomb[wb-1] += 1
    bomb_list.append(tuple([hb, wb]))

h_bomb_max = max(h_bomb)
w_bomb_max = max(w_bomb)
h_bomb_line = []
w_bomb_line = []

for i in range(h):
    if h_bomb[i] == h_bomb_max:
        h_bomb_line.append(i)

for i in range(w):
    if w_bomb[i] == w_bomb_max:
        w_bomb_line.append(i)

bomb_set = set(bomb_list)

for i in h_bomb_line:
    for j in w_bomb_line:
        if (i+1, j+1) not in bomb_set:
            print(h_bomb_max+w_bomb_max)
            exit()

print(h_bomb_max + w_bomb_max -1)

Buggy python submission (verdict: Runtime Error):
import numpy as np

h, w, m = map(int, input().split())

# l = np.array([0]*(h*w))
l = [0]*(h*w)

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))

    l[(h_input-1)*w:(h_input-1)*w+w] = list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)*w+w]))

    # l = list(map(lambda a,b: x + z, x,y))
#     l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] =  list(map(lambda x: x+1, l[w_input-1::w]))
    l[(h_input-1)*w+w_input-1] -= 1
print(max(l))
 


Fixed submission:
h, w, m = map(int, input().split())

h_bomb = [0 for i in range(h)]
w_bomb = [0 for i in range(w)]
bomb_list = []

for i in range(m):
    hb, wb = map(int, input().split())
    h_bomb[hb-1] += 1
    w_bomb[wb-1] += 1
    bomb_list.append(tuple([hb, wb]))

h_bomb_max = max(h_bomb)
w_bomb_max = max(w_bomb)
h_bomb_line = []
w_bomb_line = []

for i in range(h):
    if h_bomb[i] == h_bomb_max:
        h_bomb_line.append(i)

for i in range(w):
    if w_bomb[i] == w_bomb_max:
        w_bomb_line.append(i)

bomb_set = set(bomb_list)

for i in h_bomb_line:
    for j in w_bomb_line:
        if (i+1, j+1) not in bomb_set:
            print(h_bomb_max+w_bomb_max)
            exit()

print(h_bomb_max + w_bomb_max -1)

Buggy python submission (verdict: Runtime Error):
import numpy as np

h, w, m = map(int, input().split())

# l = np.array([0]*(h*w))
l = [0]*(h*w)

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))

    l[(h_input-1)*w:(h_input-1)*w+w] = list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)*w+w]))

    # l = list(map(lambda a,b: x + z, x,y))
#     l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] =  list(map(lambda x: x+1, l[w_input-1::w]))
    l[(h_input-1)*w+w_input-1] -= 1
print(max(l))
 


Fixed submission:
h, w, m = map(int, input().split())

h_bomb = [0 for i in range(h)]
w_bomb = [0 for i in range(w)]
bomb_list = []

for i in range(m):
    hb, wb = map(int, input().split())
    h_bomb[hb-1] += 1
    w_bomb[wb-1] += 1
    bomb_list.append(tuple([hb, wb]))

h_bomb_max = max(h_bomb)
w_bomb_max = max(w_bomb)
h_bomb_line = []
w_bomb_line = []

for i in range(h):
    if h_bomb[i] == h_bomb_max:
        h_bomb_line.append(i)

for i in range(w):
    if w_bomb[i] == w_bomb_max:
        w_bomb_line.append(i)

bomb_set = set(bomb_list)

for i in h_bomb_line:
    for j in w_bomb_line:
        if (i+1, j+1) not in bomb_set:
            print(h_bomb_max+w_bomb_max)
            exit()

print(h_bomb_max + w_bomb_max -1)

Buggy python submission (verdict: Runtime Error):
import numpy as np

h, w, m = map(int, input().split())

l = np.array([0]*(h*w))

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))
    l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] += 1
    l[(h_input-1)*w+w_input-1] -= 1

print(max(l))
 


Fixed submission:
h, w, m = map(int, input().split())

h_bomb = [0 for i in range(h)]
w_bomb = [0 for i in range(w)]
bomb_list = []

for i in range(m):
    hb, wb = map(int, input().split())
    h_bomb[hb-1] += 1
    w_bomb[wb-1] += 1
    bomb_list.append(tuple([hb, wb]))

h_bomb_max = max(h_bomb)
w_bomb_max = max(w_bomb)
h_bomb_line = []
w_bomb_line = []

for i in range(h):
    if h_bomb[i] == h_bomb_max:
        h_bomb_line.append(i)

for i in range(w):
    if w_bomb[i] == w_bomb_max:
        w_bomb_line.append(i)

bomb_set = set(bomb_list)

for i in h_bomb_line:
    for j in w_bomb_line:
        if (i+1, j+1) not in bomb_set:
            print(h_bomb_max+w_bomb_max)
            exit()

print(h_bomb_max + w_bomb_max -1)