#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
typedef struct MCMF {
  int n, m;
  vector<int> ghead, gnxt, gto, gcap;
  vector<long long> gcost;
  vector<long long> d;
  vector<int> bck;
  vector<long long> pot;
  vector<int> flow;
  void init(int _n) {
    n = _n, m = 0;
    ghead = vector<int>(n, -1);
    gnxt.clear(), gto.clear(), gcap.clear(), gcost.clear();
    d = vector<long long>(n);
    bck = vector<int>(n);
    pot = vector<long long>(n, 0);
    flow = vector<int>(n);
  }
  void addedge(int a, int b, int c, long long d) {
    gnxt.push_back(ghead[a]);
    ghead[a] = m;
    gto.push_back(b);
    gcap.push_back(c);
    gcost.push_back(+d);
    ++m;
    gnxt.push_back(ghead[b]);
    ghead[b] = m;
    gto.push_back(a);
    gcap.push_back(0);
    gcost.push_back(-d);
    ++m;
  }
  vector<long long> opt;
  pair<int, long long> solve(int s, int t) {
    for (int i = (0); i < (n); ++i) d[i] = LLONG_MAX, bck[i] = -1;
    d[s] = 0, bck[s] = -2;
    while (true) {
      bool change = false;
      for (int at = (0); at < (n); ++at)
        if (d[at] != LLONG_MAX)
          for (int x = ghead[at]; x != -1; x = gnxt[x])
            if (gcap[x] > 0) {
              int to = gto[x];
              if (d[at] + gcost[x] >= d[to]) continue;
              d[to] = d[at] + gcost[x];
              bck[to] = x ^ 1;
              change = true;
            }
      if (!change) break;
    }
    if (d[t] == LLONG_MAX) return make_pair(0, 0);
    for (int i = (0); i < (n); ++i) pot[i] = d[i];
    opt.clear();
    opt.push_back(0);
    pair<int, long long> ret = make_pair(0, 0LL);
    while (true) {
      for (int i = (0); i < (n); ++i)
        d[i] = LLONG_MAX, bck[i] = -1, flow[i] = 0;
      d[s] = 0, bck[s] = -2, flow[s] = INT_MAX;
      priority_queue<pair<long long, int> > q;
      q.push(make_pair(-d[s], s));
      while (!q.empty()) {
        long long cost = -q.top().first;
        int at = q.top().second;
        q.pop();
        if (cost > d[at]) continue;
        for (int x = ghead[at]; x != -1; x = gnxt[x])
          if (gcap[x] > 0) {
            int to = gto[x];
            long long rcost = gcost[x] + pot[at] - pot[to];
            if (d[at] + rcost >= d[to]) continue;
            d[to] = d[at] + rcost;
            bck[to] = x ^ 1;
            flow[to] = min(flow[at], gcap[x]);
            q.push(make_pair(-d[to], to));
          }
      }
      if (d[t] == LLONG_MAX) break;
      assert(flow[t] > 0);
      for (int i = (0); i < (n); ++i)
        if (d[i] != LLONG_MAX) pot[i] += d[i];
      ret.first += flow[t], ret.second += pot[t] * flow[t];
      assert(flow[t] == 1);
      opt.push_back(ret.second);
      for (int at = t; at != s; at = gto[bck[at]]) {
        gcap[bck[at]] += flow[t];
        gcap[bck[at] ^ 1] -= flow[t];
      }
    }
    return ret;
  }
} MCMF;
const int MAXN = 50;
const int MAXM = MAXN * (MAXN - 1);
const int MAXQ = 100000;
int n, m;
int a[MAXM], b[MAXM], c[MAXM];
int nq;
int qlim[MAXQ];
double qans[MAXQ];
MCMF g;
void solve() {
  g.init(n);
  for (int i = (0); i < (m); ++i) g.addedge(a[i], b[i], 1, c[i]);
  g.solve(0, n - 1);
  for (int i = (0); i < (nq); ++i) {
    double cur = 1e200;
    for (int j = (1); j < (((int)(g.opt).size())); ++j) {
      int cnt = j, budget = qlim[i];
      long long cost = g.opt[j];
      cur = min(cur, 1.0 * (budget + cost) / cnt);
    }
    qans[i] = cur;
  }
}
void run() {
  scanf("%d%d", &n, &m);
  for (int i = (0); i < (m); ++i)
    scanf("%d%d%d", &a[i], &b[i], &c[i]), --a[i], --b[i];
  scanf("%d", &nq);
  for (int i = (0); i < (nq); ++i) scanf("%d", &qlim[i]);
  solve();
  for (int i = (0); i < (nq); ++i) printf("%.15lf\n", qans[i]);
}
int main() {
  run();
  return 0;
}
