#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; //#include vector f[1005][1005]; int main() { /* for (int i = 0; i <= 100; i++) { for (int j = 0; j <= 100; j++) { f[i][j] = 100000000000; } } */ int n, m, k; cin >> n >> m >> k; for (int i = 0; i < m; i++) { int a, b, c; cin >> a >> b >> c; f[a][b].push_back(c); f[b][a].push_back(c); } int x = n; bool g[1005][1005] = {}; for (int i = 0; i <= n; i++) { g[0][i] = 1; } for (int i = 0; i < k; i++) { int d; cin >> d; for (int j = 1; j <= n; j++) { for (int y = 1; y <= n; y++) { //cout << f[i][j]; for(int t=0;t