题目描述
Background
Country T is a small nation affected by a once-in-a-century cold snap, with some cities experiencing severe impacts. The government plans to dispatch rescue teams from the capital to assist the affected cities and establish several supply points to support the rescue efforts.
Problem Description
Country T has a total of $N$ cities (numbered from $1$ to $N$), connected by $M$ bidirectional roads, each with a specified length (all greater than $0$).
There are $K$ cities affected by the disaster. The government plans to send a rescue team from the capital (city $1$) to each of these $K$ cities. To better accomplish the rescue, the government plans to establish supply points in some cities.
However, due to geographical and financial constraints, not every city can establish a supply point (whether a city can establish a supply point is unrelated to whether it is the capital or an affected city).
To expedite the rescue, each of the $K$ rescue teams will only travel along the shortest path to their destination city. The government hopes to establish as few supply points as possible in the cities where it is possible to do so, such that each rescue team has at least one shortest path to their destination city passing through at least one supply point.
Given the city and road information of Country T, you need to calculate the minimum number of supply points the government needs to establish.
Input Format
The first line of input contains three integers $N, M, K$, as described in the problem statement, with $1 \le N \le 200, 0 \le M \le 10000, 1 \le K \le 20$.
The second line contains $N$ integers, each either $0$ or $1$, indicating whether the corresponding city can establish a supply point ($1$ means it can).
The third line contains $K$ positive integers $x_i$, representing the affected city numbers. It is guaranteed that these $K$ numbers are distinct and the capital is not affected, with $1 \le x_i \le N$.
The next $M$ lines each contain three integers $u, v, w$, indicating that there is a road of length $w$ between cities $u$ and $v$, with $1 \le u, v \le N, 0 < w \le 10^9$.
The input guarantees that there is at least one solution that meets the requirements described in the problem.
Output Format
Output a single integer representing the answer.
Sample Input and Output
Sample Input #1
6 6 3
0 1 1 1 1 1
3 4 6
1 2 2
2 3 3
2 4 4
1 5 3
5 4 4
5 6 3
Sample Output #1
2
Sample Input #2
7 6 3
0 1 1 1 1 1 1
3 4 6
1 2 1
2 4 1
2 5 1
5 6 5
1 3 2
1 7 5
Sample Output #2
2
Notes
[Sample Explanation 1]
The sample corresponds to the following graph, where city $1$ is the capital and cities $3, 4, 6$ are affected:

At least $2$ supply points are needed, which can be established at cities $2, 5$ or $2, 6$. Note that they cannot be established at cities $3, 5$ because the shortest path from the capital to city $4$ is only $1 \rightarrow 2 \rightarrow 4$, and there is no shortest path passing through cities $3, 5$.
[Subtasks]
| Test Point | $N$ | $M$ | $K$ | Special Conditions |
|---|---|---|---|---|
| $1\cdots 2$ | $1 \le N \le 200$ | $M=N-1$ | $1 \le K \le 20$ | The input is a tree |
| $3\cdots 6$ | $1 \le N \le 200$ | $0 \le M \le 10000$ | $1 \le K \le 4$ | None |
| $7\cdots 12$ | $1 \le N \le 200$ | $0 \le M \le 10000$ | $1 \le K \le 16$ | None |
| $13\cdots 20$ | $1 \le N \le 200$ | $0 \le M \le 10000$ | $1 \le K \le 20$ | None |
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分