#include using namespace std; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; #define REP(i,n) for(ll i=0;i<(n);i++) #define ALL(v) v.begin(),v.end() template bool chmax(T &x, const T &y) {return (x bool chmin(T &x, const T &y) {return (x>y)?(x=y,true):false;}; constexpr ll MOD=1000000007; constexpr ll INF=2e18; int n, m, k; struct edge { int to, cost, id; }; vector g[21000]; VI d(90000000,INF); unordered_map ri; void dijkstra(int s){ priority_queue,greater

> que; d[s]=0; que.push({0,s}); while(!que.empty()){ P p=que.top(); que.pop(); int v=p.second/(1<0) to|=(1<<(ri[e.id]-1)); if(d[to]>d[p.second]+e.cost){ d[to]=d[p.second]+e.cost; que.push({d[to],to}); } } } } int main(){ cin >> n >> m >> k; VI r(k); REP(i,k) cin >> r[i]; REP(i,k) ri[r[i]-1]=i+1; int a, b, c; REP(i,m){ cin >> a >> b >> c; a--, b--; g[a].push_back(edge{b,c,i}); g[b].push_back(edge{a,c,i}); } dijkstra(0); int p=n*(1<