#P3393. 逃离僵尸岛

逃离僵尸岛

Description

The country where Xiao A lives has been invaded by zombies! Xiao A plans to escape the country via the only international airport.

The country has NN cities connected by roads. There are MM bidirectional roads. There are no self-loops or multiple edges.

Among them, KK cities have already been taken over by zombies. Entering any such city will result in infection, so these cities cannot be entered. Any city that can be reached from any zombie-controlled city by traversing at most SS roads is considered dangerous. In other words, if a city’s distance to any zombie-controlled city is at most SS, then it is dangerous.

Xiao A lives in city 11, the international airport is in city NN, and these two cities are not invaded. Xiao A spends an entire day to traverse each single road (moving directly from one city to another), so he must stay at an inn at night. Inns in safe cities are cheaper and cost PP, while inns in dangerous cities need extra security measures and thus cost QQ. All dangerous cities share the same lodging price, and so do all safe cities. In cities 11 and NN, no lodging is required.

Xiao A is frugal, so he wants to know the minimum cost to travel from city 11 to city NN.

The input guarantees that there exists a path and that he can successfully escape.

Input Format

  • The first line contains 44 integers N,M,K,SN, M, K, S.
  • The second line contains two integers P,QP, Q.
  • The next KK lines each contain one integer cic_i, the index of a zombie-controlled city.
  • The next MM lines each contain two integers ai,bia_i, b_i, indicating an undirected edge.

Output Format

Output a single integer, the minimum total cost.

13 21 1 1
1000 6000
7
1 2
3 7
2 4
5 8
8 9
2 5
3 4
4 7
9 10
10 11
5 9
7 12
3 6
4 5
1 3
11 12
6 7
8 11
6 13
7 8
12 13
11000

Hint

  • For 20%20\% of the testdata, N50N \le 50.
  • For 100%100\% of the testdata, 2N1052 \le N \le 10^5, 1M2×1051 \le M \le 2 \times 10^5, 0KN20 \le K \le N - 2, 0S1050 \le S \le 10^5, 1P<Q1051 \le P < Q \le 10^5.

Translated by ChatGPT 5