#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;

const int N = 110;
const int M = 1000010;
const int inf = 1000000000;

struct Edge
{
    int f, t, d;
}e[M];

int point[N], next[M], ne;
int dis[2][N], q[N];
bool u[N];

void add_edge(int f, int t, int d)
{
    e[ne].f = f, e[ne].t = t, e[ne].d = d;
    next[ne] = point[f], point[f] = ne++;
}

void spfa(int s, int n, int k)
{
    int i, tmp, f, r;
    for(i = 0; i < n; ++i) {
        dis[k][i] = inf;
        u[i] = false;
    }
    dis[k][s] = 0;
    u[s] = true;
    f = 0, r = 1;
    q[f] = s;
    while(f != r) {
        tmp = q[f];
        f = (f + 1) % n;
        u[tmp] = false;
        for(i = point[tmp]; i != -1; i = next[i]) {
            if(dis[k][e[i].t] > dis[k][tmp] + e[i].d) {
                dis[k][e[i].t] = dis[k][tmp] + e[i].d;
                if(!u[e[i].t]) {
                    u[e[i].t] = true;
                    q[r] = e[i].t;
                    r = (r + 1) % n;
                }
            }
        }
    }
}

struct Node
{
    int d, id;
    double cnt;
    bool operator < (const Node &x) const {
        return d < x.d;
    }
}qi[N];

bool cmp(const Node &x, const Node &y)
{
    return x.id < y.id;
}

int qid[N];
double cnt[N];

void update(int s, int n)
{
    for(int i = 0; i < n; ++i)
        qid[qi[i].id] = i;
    qi[0].cnt = 1;
    for(int i = 0; i < n; ++i) {
        int f = qi[i].id;
        for(int j = point[f]; j != -1; j = next[j]) {
            int t = e[j].t;
            if(!u[t])   continue;
            if(dis[0][f] + e[j].d == dis[0][t])
                qi[qid[t]].cnt += qi[i].cnt;
        }
    }
    qi[0].cnt = qi[qid[n - 1]].cnt;

    for(int k = 1; k < n; ++k) {
        memset(cnt, 0, sizeof(cnt));
        cnt[0] = 1;
        for(int i = 0; i < n; ++i) {
            if(i == k)  continue;
            int f = qi[i].id;
            for(int j = point[f]; j != -1; j = next[j]) {
                int t = e[j].t;
                if(!u[t])   continue;
                if(dis[0][f] + e[j].d == dis[0][t])
                    cnt[qid[t]] += cnt[i];
            }
        }
        if(k != qid[n - 1])
            qi[k].cnt = qi[qid[n - 1]].cnt - cnt[qid[n - 1]];
    }
}

int main()
{
    int i, n, m, p, a, b, d, iid;
    while(scanf("%d%d%d", &n, &m, &p) && n + m + p) {
        ne = 0;
        memset(point, -1, sizeof(point));
        for(i = 0; i < m; ++i) {
            scanf("%d%d%d", &a, &b, &d);
            add_edge(a, b, d);
            add_edge(b, a, d);
        }
        spfa(0, n, 0);
        spfa(n - 1, n, 1);
        /*for(int j = 0; j < 2; ++j) {
            printf("********\n");
            for(i = 0; i < n; ++i) {
                printf("%d: %d\n", i, dis[j][i]);
            }
        }*/
        memset(u, false, sizeof(u));
        for(i = 0; i < n; ++i) {
            qi[i].d = dis[0][i];
            qi[i].cnt = 0, qi[i].id = i;
            if(dis[0][i] + dis[1][i] == dis[0][n - 1])
                u[i] = true;
        }
        sort(qi, qi + n);
        update(0, n);
        sort(qi, qi + n, cmp);
        while(p--) {
            scanf("%d", &iid);
            if(qi[n - 1].cnt == 0) {
                printf("0.00000000\n");
            }
            else {
                printf("%.14f\n", qi[iid].cnt * 1.0 / qi[n - 1].cnt);
            }
        }
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 0