Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. books = []
  2. count = 0
  3. with open('input.txt') as file:
  4.     n ,v , t =[int(i) for i in file.readline().split()]
  5.     for i in range(n):
  6.         x , y = [int(i) for i in file.readline().split('-')]
  7.         books.append(int(x)*int(y))
  8. books.sort()
  9. symbols = v*t
  10. for i in books:
  11.     if symbols - i >= 0:
  12.         count+=1
  13.         symbols -=i
  14.     else:
  15.         break
  16. print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement