Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = open('5.txt')
- K, N = map(int, file.readline().split())
- a = []
- for i in range(N):
- st, end = map(int, file.readline().split())
- a.append((st, end))
- a.sort()
- house = [0] * 1000
- last = 0
- for i in range(N):
- st, end = a[i]
- for j in range(1000):
- if house[j] < st:
- house[j] = end
- last = len([x for x in house if x > st])
- break
- house = [x for x in house if x != 0]
- print(len(house) / K, last)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement