Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=69934
- data = open('69934.txt').readlines()
- n, m, k = map(int, data[0].split())
- inf = 10000000
- best_row = [inf] * (k + 1)
- for e in data[1:]:
- x, y = map(int, e.split())
- best_row[y]= min(best_row[y], x - 1)
- mx_x = -1
- mx_y = -1
- for i in range(1, k):
- cur_row = min(best_row[i], best_row[i + 1])
- if cur_row >= mx_x and cur_row != inf:
- mx_x = cur_row
- mx_y = i + 1
- print(mx_x, mx_y)
Advertisement
Add Comment
Please, Sign In to add comment