23 lines
447 B
Python
23 lines
447 B
Python
from math import dist
|
|
def solve(input):
|
|
points = []
|
|
for line in open(input):
|
|
x,y = map(int, line.strip().split(","))
|
|
points.append((x,y))
|
|
|
|
def areas():
|
|
for p in points:
|
|
for q in points:
|
|
if p != q:
|
|
yield area(p,q)
|
|
|
|
print(max(areas()))
|
|
|
|
def area(p,q):
|
|
dx = abs(p[0] - q[0]) + 1
|
|
dy = abs(p[1] - q[1]) + 1
|
|
return dx*dy
|
|
|
|
solve("sample")
|
|
solve("input")
|