소스코드

import sys
input = sys.stdin.readline

result = 0 # 가장 큰 종이 조각의 넓이(결과)
width, height = list(map(int, input().strip().split()))
CUTS = int(input().strip())

cutline_x, cutline_y = [0, width], [0, height]
for _ in range(CUTS):
	x,y = list(map(int, input().strip().split()))
	cutline_x.append(x)
	cutline_y.append(y)
# 정렬
cutline_x.sort()
cutline_y.sort()

max_width = max(cutline_x[i+1] - cutline_x[i] for i in range(len(cutline_x)-1))
max_height = max(cutline_y[i+1] - cutline_y[i] for i in range(len(cutline_y)-1))
result = max_width * max_height

sys.stdout.write(f"{result}\\n")

풀이

가로, 세로로 자를 지점들을 저장해두고 정렬한 후에, 인접한 값끼리 차이를 구합니다. 그중에서 가장 큰 차이의 너비와 높이를 구하고, 최대 높이차이와 최대 너비차이를 곱하면 결과가 됩니다!