Advertisement
Stily

Untitled

Feb 17th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. number_of_rooms = int(input())
  2. available_chairs = 0
  3. for room in range(1, number_of_rooms + 1):
  4. chairs = input().split()
  5. total_chairs = chairs[0].count('X')
  6. taken_chairs = int(chairs[1])
  7. if taken_chairs > total_chairs:
  8. print(f'{taken_chairs - total_chairs} more chairs needed in room {room}')
  9. available_chairs += (total_chairs - taken_chairs)
  10.  
  11. if available_chairs>=0:
  12. print(f'Game On, {available_chairs} free chairs left')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement