Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- people = int(input())
- lift = list(map(int, input().split()))
- for wagon, spaces in enumerate(lift):
- if spaces < 4:
- available = 4 - spaces
- if people - available >= 0:
- people -= available
- lift[wagon] += available
- else:
- lift[wagon] += people
- people -= people
- not_balance = True
- for count in range(len(lift)):
- if lift[count] < 4:
- not_balance = False
- if not_balance and people == 0:
- print(*lift)
- elif people == 0:
- print('The lift has empty spots!')
- print(*lift)
- else:
- print(f"There isn't enough space! {people} people in a queue!")
- print(*lift)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement