Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def func(i):
- return int(i[2])
- a = open("input.txt", "r")
- b = open("output.txt", "w")
- res = []
- k = int(a.readline())
- count = 0
- for elem in a:
- elem = elem.split()
- if int(elem[2]) > k:
- count += 1
- res.append(elem)
- res.sort(key=func, reverse=True)
- cur = 1
- b.write(str(count) + '\n')
- for elem in res:
- if int(elem[2]) > k:
- if cur != count:
- print(str(cur) + ')', str(elem[1][0]) + '.', str(elem[0]), elem[2], file=b)
- else:
- print(str(cur) + ')', str(elem[1][0]) + '.', str(elem[0]), elem[2], file=b, end='')
- cur += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement