#K13781. Total Salary Increase Calculation

    ID: 23989 Type: Default 1000ms 256MiB

Total Salary Increase Calculation

Total Salary Increase Calculation

You are given details of a company’s employees and a list of candidate employees whose salary may be increased. The company has n employees. The first list A contains the employee IDs and the second list B contains their corresponding salaries. You are also provided with m candidate employee IDs in list C and an integer k which is the amount by which each valid employee's salary will be increased.

An employee is considered valid if his/her ID exists in the company's employee list A. The total salary increase is defined as:

\(\text{total\_increase} = \text{(number of valid employees in } C\text{)} \times k\)

Your task is to compute and output the total salary increase.

inputFormat

The input is read from standard input and consists of the following lines:

  1. An integer n representing the number of employees.
  2. n space-separated integers representing the employee IDs (list A).
  3. n space-separated integers representing the employee salaries (list B). (Note: This part is not used in the calculation.)
  4. An integer m representing the number of candidate employees.
  5. m space-separated integers representing the candidate employee IDs (list C).
  6. An integer k representing the salary increase amount.

outputFormat

Output a single integer representing the total salary increase on standard output.

## sample
4
101 102 103 104
5000 6000 5500 7000
3
102 103 105
200
400