typedef long long ll; typedef long double ld; #include using namespace std; #define int long long signed main(){ ll n,m,k; std::cin >> n>>m>>k; map r; set ed; vector> rr; ed.insert(0); ed.insert(n-1); for (int i = 0; i < k; i++) { ll tmp; std::cin >> tmp; tmp--; r[tmp] = true; } vector>> edges(n); for (int i = 0; i < m; i++) { ll a,b,c; std::cin >> a>>b>>c; a--;b--; edges[a].push_back({b, c}); edges[b].push_back({a, c}); if(r[i]){ ed.insert(a); ed.insert(b); rr.push_back({a,b,c}); } } map> d; for (auto st : ed) { auto &dn = d[st]; dn.resize(n,1e18); dn[st] = 0; priority_queue,vector>,greater>> pq; pq.push({0, st}); while(!pq.empty()){ auto [dis, pos] = pq.top();pq.pop(); if(dn[pos]dis+c){ dn[v] = dis+c; pq.push({dn[v],v}); } } } } vector>> dp(1<>(ed.size(), vector(ed.size(), 1e18))); dp[0][0][0] = 0; ll cntt = 0; map con,con2; for (auto e : ed) { con[e] = cntt; con2[cntt] = e; cntt++; } for (int i = 0; i < (1<>bit&1){ auto [a,b,c] = rr[bit]; dp[i][j][l] = min(dp[i][j][l], dp[i&~(1<