#Q98. 「一本通 3.5 练习 4」抢掠计划
「一本通 3.5 练习 4」抢掠计划
Description
Original Source: APIO 2009
All roads in Siruseri city are one-way. Different roads are connected by intersections. According to the law, each intersection has an ATM machine from Siruseri Bank. Strangely, all bars in Siruseri are also located at intersections, though not every intersection has a bar.
Banditji plans to carry out the most audacious ATM robbery in Siruseri's history. Starting from the city center, he will drive along one-way roads, robbing all ATMs he passes, and finally celebrate his victory at a bar.
Using advanced hacking skills, he has obtained the amount of cash that can be stolen from each ATM. He wants your help to calculate the maximum total cash he can rob when starting from the city center and ending at a bar. He can pass through the same intersection or road any number of times. However, once he robs an ATM, it will no longer contain any money.
For example, suppose the city has 6 intersections, and the road connections are as shown in the following diagram:

The city center is at intersection 1, marked by an entrance symbol →. Intersections with bars are indicated by double circles. The amount of money available at each ATM is labeled above the intersection. In this example, Banditji can rob a total of 47, following the route: 1-2-4-1-2-3-5.
Input Format
The first line contains two integers N, M. N represents the number of intersections, and M represents the number of roads.
The next M lines each contain two integers, both between 1 and N. The two integers in the (i+1)-th line represent the starting and ending intersections of the i-th road.
The next N lines each contain an integer, representing the amount of money in the ATM at each intersection in order.
The following line contains two integers S, P. S is the number of the city center intersection, which is the starting point. P is the number of bars.
The next line contains P integers, representing the numbers of the intersections where the bars are located.
Output Format
Output an integer, representing the maximum total cash Banditji can rob when starting from the city center and ending at a bar.
Sample 1
6 7
1 2
2 3
3 5
2 4
4 1
2 6
6 5
10
12
8
16
1
5
1 4
4
3
5
6
47
Data Range and Hints
50% of the input guarantees N, M ≤ 3000.
100% of the input guarantees N, M ≤ 500000.
The amount of money in each ATM is a non-negative integer not exceeding 4000. The input ensures that you can reach at least one bar from the city center along Siruseri's one-way roads.