#include <bits/stdc++.h>
using namespace std;
int Q, n, m, i, j, k, l, x, L, R, mid, mid2;
int a[50001][4], ls[51], len;
int Cost[51];
double ans, S;
void NEW(int x, int y, int z, int w) {
  ++len;
  a[len][0] = y;
  a[len][1] = ls[x];
  ls[x] = len;
  a[len][2] = z;
  a[len][3] = w;
}
void New(int x, int y, int z, int w) { NEW(x, y, z, w), NEW(y, x, 0, -w); }
int d[50001], f[51], g[51], I, h, t;
void work() {
  while (1) {
    h = 0, t = 1, d[1] = 1;
    memset(f, 180, sizeof(f)), f[1] = g[1] = 0;
    while (h < t) {
      for (i = ls[d[++h]]; i; i = a[i][1])
        if (a[i][2] && f[a[i][0]] < f[d[h]] + a[i][3]) {
          f[a[i][0]] = f[d[h]] + a[i][3];
          g[a[i][0]] = i;
          d[++t] = a[i][0];
        }
    }
    if (f[n] >= -1000000000) {
      ++I, Cost[I] = f[n] + Cost[I - 1];
      for (i = n; i != 1; i = a[g[i] ^ 1][0]) --a[g[i]][2], ++a[g[i] ^ 1][2];
    } else
      break;
  }
}
double js(int x, int t) { return ((double)x - Cost[t]) / t; }
int main() {
  scanf("%d%d", &n, &m), len = 1;
  for (i = 1; i <= m; i++) scanf("%d%d%d", &j, &k, &l), New(j, k, 1, -l);
  work();
  scanf("%d", &Q);
  for (; Q; --Q) {
    scanf("%d", &x), ans = 2147483647;
    L = 1, R = I;
    while (R - L > 3) {
      mid = (L + R) / 2, mid2 = (mid + R) / 2;
      if (js(x, mid) > js(x, mid2))
        L = mid;
      else
        R = mid2;
    }
    for (i = L; i <= R; i++) S = js(x, i), ans = (ans < S ? ans : S);
    printf("%.10lf\n", ans);
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}
