Problem: The best night ever in the world has come! It's 8 p.m. of December 24th, yes, the night of Cristmas Eve. Santa Clause comes to a silent city with ringing bells. Overtaking north wind, from a sleigh a reindeer pulls she shoot presents to soxes hanged near windows for children.

The sleigh she is on departs from a big christmas tree on the fringe of the city. Miracle power that the christmas tree spread over the sky like a web and form a paths that the sleigh can go on. Since the paths with thicker miracle power is easier to go, these paths can be expressed as undirected weighted graph.

Derivering the present is very strict about time. When it begins dawning the miracle power rapidly weakens and Santa Clause can not continue derivering any more. Her pride as a Santa Clause never excuses such a thing, so she have to finish derivering before dawning.

The sleigh a reindeer pulls departs from christmas tree (which corresponds to 0th node), and go across the city to the opposite fringe (n-1 th node) along the shortest path. Santa Clause create presents from the miracle power and shoot them from the sleigh the reindeer pulls at his full power. If there are two or more shortest paths, the reindeer selects one of all shortest paths with equal probability and go along it.

By the way, in this city there are p children that wish to see Santa Clause and are looking up the starlit sky from their home. Above the i-th child's home there is a cross point of the miracle power that corresponds to c[i]-th node of the graph. The child can see Santa Clause if (and only if) Santa Clause go through the node.

Please find the probability that each child can see Santa Clause.

Constraints

* 3 ≤ n ≤ 100
* There are no parallel edges and a edge whose end points are identical.
* 0 < weight of the edge < 10000

Input

Input consists of several datasets.

The first line of each dataset contains three integers n, m, p, which means the number of nodes and edges of the graph, and the number of the children. Each node are numbered 0 to n-1.

Following m lines contains information about edges. Each line has three integers. The first two integers means nodes on two endpoints of the edge. The third one is weight of the edge.

Next p lines represent c[i] respectively.

Input terminates when n = m = p = 0.

Output

For each dataset, output p decimal values in same order as input. Write a blank line after that.

You may output any number of digit and may contain an error less than 1.0e-6.

Example

Input

3 2 1
0 1 2
1 2 3
1
4 5 2
0 1 1
0 2 1
1 2 1
1 3 1
2 3 1
1
2
0 0 0


Output

1.00000000

0.50000000
0.50000000

Solution (in CPP):

Solution:
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
using namespace std;

struct NODE{
	int to,cost;
	NODE(int to,int cost) : to(to) , cost(cost) {}
	NODE(){}
};
bool operator < (const NODE &a,const NODE &b){
	return a.cost > b.cost;
}
int done[110] = {};
double dp[110] = {} , rdp[110] = {};

vector<NODE> g[100];
int n,m,p;

double dfs(int x,int cst){
	if( done[x] != cst ) return 0;
	if( x == n - 1 ) return 1;
	if( dp[x] != -1 ) return dp[x];
	double ans = 0;
	for(int i = 0 ; i < g[x].size() ; i++)
		ans += dfs(g[x][i].to,cst+g[x][i].cost);
	return dp[x] = ans;
}

double rdfs(int x,int cst){
	if( done[n-1] - done[x] != cst ) return 0;
	if( x == 0 ) return 1;
	if( rdp[x] != -1 ) return rdp[x];
	double ans = 0;
	for(int i = 0 ; i < g[x].size() ; i++)
		ans += rdfs(g[x][i].to,cst+g[x][i].cost);
	return rdp[x] = ans;
}
int main(){
	while(cin >> n >> m >> p && (n||m||p) ){
		for(int i = 0 ; i < n ; i++) g[i].clear();
		for(int i = 0 ; i < m ; i++){
			int a,b,c;
			cin >> a >> b >> c;
			g[a].push_back( NODE(b,c) );
			g[b].push_back( NODE(a,c) );
		}
		for(int i = 0 ; i < 110 ; i++) done[i] = -1;
		for(int i = 0 ; i < 110 ; i++)
				dp[i] = rdp[i] = -1;
		priority_queue<NODE> Q;
		Q.push(NODE(0,0));
		while(Q.size()){
			NODE q = Q.top(); Q.pop();
			if( done[q.to] != -1 ) continue;
			else done[q.to] = q.cost;
			for(int i = 0 ; i < g[q.to].size() ; i++)
				Q.push(NODE(g[q.to][i].to,q.cost+g[q.to][i].cost));
		}
		double all = dfs(0,0);
		//cout << all << endl;
		for(int i = 0 ; i < p ; i++){
			int a;
			cin >> a;
			if( done[a] == -1 ){
				printf("%.8lf\n",0.0);
			}else{
				double A = dfs(a,done[a]);
				double B = rdfs(a,done[n-1] - done[a]);
				printf("%.8lf\n",1.0 * A*B / all);
			}
		}
		cout << endl;
	}
	
}