#M1001. Buy Clothes

Buy Clothes

Buy Clothes

Background of the topic

Little P opened a clothing store and bought a lot of goods...

Description

P buys nn pieces of clothing for aia_i yuan each, but will get bib_i, but only by selling it. There are tt minutes, and someone may come to see the clothes every minute, as we all know, to look at the clothes, to touch the clothes, each touch will reduce the completeness of 1%1\%, let the remaining completeness be mm%, then the net profit is bi×m%ai\lfloor b_i\times m\% \rfloor-a_i.

Input format

Enter n,tn,t on the first line.

The second line aia_i.

The third line bib_i.

The fourth line tt counts, and in the ii minute a person touches the cic_i piece of clothing, and if cic_i is 00, no one comes to see the clothes.

Output Format

Output total net profit.

Sample

Sample #1输入

2 2
1 1
5 4
1 0

Sample #1输出

6

Data Conventions

For data of 100%100\%: $1\leqslant n\leqslant100,1\leqslant t\leqslant 100\times n-10,1\leqslant a_i,b_i\leqslant1000,1\leqslant c_i\leqslant n$.