Advertisement
Spocoman

05. Office Chairs

Feb 11th, 2022
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. rooms = int(input())
  2. total_chairs = []
  3.  
  4. for i in range(rooms):
  5.     room = input().split(' ')
  6.     diff_chairs = len(room[0]) - int(room[1])
  7.     total_chairs.append(diff_chairs)
  8.  
  9. if len(total_chairs) == len([x for x in total_chairs if x >= 0]):
  10.     print(f'Game On, {sum(total_chairs)} free chairs left')
  11. else:
  12.     for i in range(len(total_chairs)):
  13.         if total_chairs[i] < 0:
  14.             print(f'{abs(total_chairs[i])} more chairs needed in room {i + 1}')
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement