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