Guest User

Untitled

a guest
Feb 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. n, ss=int(raw_input()), map(int,raw_input().split())
  2. money=0
  3. for i in range(int(raw_input())):
  4. item,price=map(int, raw_input().split())
  5. try:
  6. ss.remove(item)
  7. money=money+price
  8. except:
  9. continue
  10. print money
Add Comment
Please, Sign In to add comment