You are on page 1of 1

# Enter your code here. Read input from STDIN.

Print output to STDOUT


from collections import Counter
n=int(input())
s=list(map(int,input().split()))
m=int(input())
c=dict(Counter(s))
for i in range(m):
x,y=map(int,input().split())
if(x==c[i].key):
a=c[i].key #a=6
flag=c[i].value #flag=2
temp=0
for j in range(c.value):
if(flag==0):
y=0
break
else:
flag=flag-1
temp=temp+y
break
break
break
print(temp)

You might also like