Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- voucher = int(input())
- ticket = 0
- other = 0
- while True:
- buy = input()
- if buy == "End":
- break
- price = ord(buy[0])
- if len(buy) > 8:
- price += ord(buy[1])
- if voucher >= price:
- ticket += 1
- else:
- break
- else:
- if voucher >= price:
- other += 1
- else:
- break
- voucher -= price
- print(ticket)
- print(other)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement