Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open ('26.txt')
- next(f)
- def razdel(s):
- st = tuple(map(int, s.split()))
- return st[0], -st[1]
- def poisk(k):
- one = k[0]
- two = k[1]
- return one[0] == two[0] and two[1] - one[1] == 3
- pairs = sorted(map(razdel, f))
- fil = filter(poisk, zip(pairs, pairs[1:]))
- true = tuple(map(lambda x: x[1], fil))
- print(true[-1][0], (-true[-1][1]))
Advertisement
Add Comment
Please, Sign In to add comment