Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n,x=map(int,input().split())
- a=[]
- q=0
- for i in range (n):
- a,b=map(str,input().split())
- if a=='+':
- x+=int(b)
- else:
- if x>=int(b):
- x-=int(b)
- else:
- q+=1
- print(x,q)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement