Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- ontrain = 0
- x = sys.stdin.readline()
- y = x.split()
- cap = int(y[0])
- b = int(y[1])
- for i in range(0, b):
- z = sys.stdin.readline()
- g = z.split()
- left = int(g[0])
- enter = int(g[1])
- stay = int(g[2])
- print(g)
- if left > ontrain:
- print("impossible2")
- elif left > cap+1:
- print("impossible22")
- else:
- ontrain =- left
- if enter > cap+1:
- print("impossible1")
- else:
- ontrain =+ enter
- space = cap-ontrain
- if stay < space:
- print("impossible3")
- else:
- ontrain += stay -space
- #print(j)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement