27 lines
698 B
Python
27 lines
698 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# file = "./ex.txt"
|
|
file = "./input.txt"
|
|
|
|
if __name__ == "__main__":
|
|
solution = 0
|
|
positions = []
|
|
input_file = open(file, "r")
|
|
for line in input_file:
|
|
line = line.strip()
|
|
if line == "":
|
|
continue
|
|
else:
|
|
a,b = line.split(',')
|
|
a = int(a)
|
|
b = int(b)
|
|
positions.append([a,b])
|
|
|
|
for i in range(len(positions)):
|
|
for j in range(i+1, len(positions)):
|
|
area = (abs(positions[i][0]-positions[j][0])+1)*(abs(positions[i][1]-positions[j][1])+1)
|
|
if area > solution:
|
|
solution = area
|
|
print(f"Solution: {solution}")
|