hiho week 219 register

Ended

Participants:164

Verdict:Accepted
Score:100 / 100
Submitted:2018-09-15 17:31:45

Lang:Python2

Edit
1
2
3
4
5
6
7
8
9
10
11
n = input()
p = [tuple(map(intraw_input().split())) for i in range(n)]
s = set(p)
ret = 1e18
for i in range(n):
    for j in range(i + 1n):
        x1y1 = p[i]
        x2y2 = p[j]
        if x1 != x2 and y1 != y2 and (x1y2) in s and (x2y1) in s:
            ret = min(retabs(x1 - x2) * abs(y1 - y2))
print ret if ret != 1e18 else -1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX