---
title: 對發票
tags: Code
description: Abs
---
43題 對發票
---
<br>
```python
st1No = input()
st2No =input()
st3No = input().split(' ')
st4No =input().split(' ')
bonus ={st1No:10**7,st2No:2*(10**6),st3No[0]:2*(10**5),st3No[1]:2*(10**5),st3No[2]:2*(10**5),st4No[0]:200,st4No[1]:200,st4No[2]:200}
no =[40000,10000,4000,1000,200]
n =int(input())
total =0
def CheckInvoice(invoiceNo):
money =0
for i in bonus:
if i == invoiceNo:
money = bonus[i]
break
for i in st3No:
count =0
for j in range(-7,-2):
if invoiceNo[j:] in i:
if no[count]>money:
money = no[count]
break
count+=1
for i in st4No:
if invoiceNo[-3:] in i:
if 200>money:
money = 200
break
return money
for i in range(n):
invoiceNo = input()
total += CheckInvoice(invoiceNo)
print(total)
```