Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, ss=int(raw_input()), map(int,raw_input().split())
- money=0
- for i in range(int(raw_input())):
- item,price=map(int, raw_input().split())
- try:
- ss.remove(item)
- money=money+price
- except:
- continue
- print money
Add Comment
Please, Sign In to add comment