#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>


using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define CLEAR(arr, val) memset(arr, val, sizeof(arr))

#define rep(i, n) for (int i = 0; i < n; ++i)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

typedef long long ll;
typedef pair<int, int> pint;

const double EPS = 1e-8;
const double PI = acos(-1.0);
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };


struct Edge
{
	int to, cost;
	Edge(int to, int cost)
		: to(to), cost(cost) {}
};

vector<vector<int> > clean(const vector<vector<int> >& e)
{
	int n = e.size();
	vector<bool> on_min_path(n);
	queue<int> q;
	on_min_path[n - 1] = true;
	q.push(n - 1);
	while (!q.empty())
	{
		int cur = q.front(); q.pop();
		for (int i = 0; i < e[cur].size(); ++i)
		{
			int to = e[cur][i];
			if (!on_min_path[to])
			{
				on_min_path[to] = true;
				q.push(to);
			}
		}
	}

	vector<vector<int> > res(n);
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < e[i].size(); ++j)
			if (on_min_path[i] && on_min_path[e[i][j]])
				res[i].push_back(e[i][j]);
	return res;
}
vector<vector<int> > prev_nodes(const vector<vector<Edge> >& edges)
{
	int n = edges.size();

	const int INF = 1e7;
	vector<int> dis(n, INF);
	vector<vector<int> > prevv(n);
	priority_queue<pint, vector<pint>, greater<pint> > q;
	dis[0] = 0;
	q.push(pint(0, 0));
	while (!q.empty())
	{
		pint tt = q.top(); q.pop();
		int cur = tt.second, cost = tt.first;

		if (cost > dis[cur])
			continue;

		foreach (e, edges[cur])
		{
			int to = e->to, nc = cost + e->cost;
			if (nc < dis[to])
			{
				dis[to] = nc;
				prevv[to].clear();
				prevv[to].push_back(cur);
				q.push(pint(nc, to));
			}
			else if (nc == dis[to])
				prevv[to].push_back(cur);
		}
	}

	return clean(prevv);
}

vector<vector<int> > rev(const vector<vector<int> >& e)
{
	vector<vector<int> > res(e.size());
	for (int i = 0; i < e.size(); ++i)
		for (int j = 0; j < e[i].size(); ++j)
			res[e[i][j]].push_back(i);
	return res;
}

double in_paths(vector<double>& dp, const vector<vector<int> >& e, int v)
{
	if (dp[v] != -1)
		return dp[v];
	else if (e[v].empty())
		return dp[v] = 1;

	double res = 0;
	for (int i = 0; i < e[v].size(); ++i)
		res += in_paths(dp, e, e[v][i]);
	return dp[v] = res;
}
int main()
{
	int n, m, p;
	while (cin >> n >> m >> p, n)
	{
		vector<vector<Edge> > edges(n);
		for (int i = 0; i < m; ++i)
		{
			int a, b, c;
			cin >> a >> b >> c;
			edges[a].push_back(Edge(b, c));
			edges[b].push_back(Edge(a, c));
		}
		vector<vector<int> > prevv = prev_nodes(edges);
		//for (int i = 0; i < n; ++i)
		//{
		//	printf("%d: ", i);
		//	for (int j = 0; j < prevv[i].size(); ++j)
		//		printf("%d ", prevv[i][j]);
		//	puts("");
		//}puts("");

		vector<double> in(n, -1), out(n, -1);
		in_paths(in, prevv, n - 1);
		in_paths(out, rev(prevv), 0);

		vector<double> paths(n);
		for (int i = 0; i < n; ++i)
			if (in[i] != -1)
				paths[i] = in[i] * out[i];
		double total_paths = paths[0];

		//for (int i = 0; i < n; ++i)
		//{
		//	printf("%d: %f %f\n", i, in[i], out[i]);
		//}

		while (p--)
		{
			int c;
			cin >> c;
			
			printf("%.8f\n", paths[c] / total_paths);
		}
		puts("");
	}
}

Measured memory_bytes: 0