Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- price_of_voucher = int(input())
- command = input()
- tickets = 0
- others = 0
- price = 0
- while command != 'End':
- product = command
- if len(product) > 8:
- price += ord(product[0]) + ord(product[1])
- if price > price_of_voucher:
- break
- tickets += 1
- else:
- price += ord(product[0])
- if price > price_of_voucher:
- break
- others += 1
- command = input()
- print(tickets)
- print(others)
Advertisement
Add Comment
Please, Sign In to add comment