Codeforces Round 543 (Div. 2, based on Technocup 2019 Final Round)
A
Technogoblet of Fire
Codeforces
1100
原题
←B →
翻译中…

Everybody knows that the m-coder Tournament will happen soon. m schools participate in the tournament, and only one student from each school participates.

翻译中…

There are a total of n students in those schools. Before the tournament, all students put their names and the names of their schools into the Technogoblet of Fire. After that, Technogoblet selects the strongest student from each school to participate.

翻译中…

Arkady is a hacker who wants to have k Chosen Ones selected by the Technogoblet. Unfortunately, not all of them are the strongest in their schools, but Arkady can make up some new school names and replace some names from Technogoblet with those. You can't use each made-up name more than once. In that case, Technogoblet would select the strongest student in those made-up schools too.

翻译中…

You know the power of each student and schools they study in. Calculate the minimal number of schools Arkady has to make up so that k Chosen Ones would be selected by the Technogoblet.

翻译中…

Input

翻译中…

The first line contains three integers n, m and k (1≤n≤100, 1≤m,k≤n) — the total number of students, the number of schools and the number of the Chosen Ones.

翻译中…

The second line contains n different integers p1,p2,…,pn (1≤pi≤n), where pi denotes the power of i-th student. The bigger the power, the stronger the student.

翻译中…

The third line contains n integers s1,s2,…,sn (1≤si≤m), where si denotes the school the i-th student goes to. At least one student studies in each of the schools.

翻译中…

The fourth line contains k different integers c1,c2,…,ck (1≤ci≤n)  — the id's of the Chosen Ones.

翻译中…

Output

翻译中…

Output a single integer  — the minimal number of schools to be made up by Arkady so that k Chosen Ones would be selected by the Technogoblet.

翻译中…

Note

翻译中…

In the first example there's just a single Chosen One with id 3. His power is equal to 3, but in the same school 1, there's a student with id 5 and power 6, and that means inaction would not lead to the latter being chosen. If we, however, make up a new school (let its id be 4) for the Chosen One, Technogoblet would select students with ids 2 (strongest in 3), 5 (strongest in 1), 6 (strongest in 2) and 3 (strongest in 4).

翻译中…

In the second example, you can change the school of student 3 to the made-up 5 and the school of student 4 to the made-up 6. It will cause the Technogoblet to choose students 8, 7, 6, 5, 3 and 4.

翻译中…

样例

Input #1
7 3 1
1 5 3 4 6 7 2
1 3 1 2 1 2 3
3
Output #1
1
InputCopy OutputCopy
Input #2
8 4 4
1 2 3 4 5 6 7 8
4 3 2 1 4 3 2 1
3 4 5 6
Output #2
2
InputCopy OutputCopy
题目信息
题号
1121A
时间限制
1 s
内存限制
256 MB
标签
模拟
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。