#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
inline void gmx(int &x, int y) {
  if (x < y) x = y;
}
inline void gmn(int &x, int y) {
  if (x > y) x = y;
}
inline int read() {
  char c = getchar();
  int z = 0, f = 1;
  while (c != '-' && (c > '9' || c < '0')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') z = (z << 1) + (z << 3) + c - '0', c = getchar();
  return z * f;
}
const int N = 1e5 + 5, M = 3e5 + 5;
double Cost[N], k;
int m;
namespace COSTFLOW {
int n, FLOW, COST, head[N], cnt = 1;
struct EDGE {
  int from, to, nex, caps, f;
} e[M];
inline void ins(int x, int y, int z, int w) {
  e[++cnt] = (EDGE){x, y, head[x], z, w};
  head[x] = cnt;
  e[++cnt] = (EDGE){y, x, head[y], 0, -w};
  head[y] = cnt;
}
int h[N], dis[N], from[N], flow[N], vis[N];
inline void init(int _n) { n = _n; }
bool dj(int s, int t) {
  for (int i = 1; i <= n; i++)
    h[i] = min(h[i] + dis[i], inf), dis[i] = inf, vis[i] = 0, flow[i] = 0;
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  dis[s] = 0;
  flow[s] = inf;
  q.push(pair<int, int>(0, s));
  while (!q.empty()) {
    int x = q.top().second;
    q.pop();
    if (vis[x]) continue;
    vis[x] = 1;
    for (register int i = head[x]; i; i = e[i].nex)
      if (e[i].caps > 0 && dis[e[i].to] > dis[x] + e[i].f + h[x] - h[e[i].to])
        dis[e[i].to] = dis[x] + e[i].f + h[x] - h[e[i].to],
        flow[e[i].to] = min(flow[x], e[i].caps), from[e[i].to] = i,
        q.push(pair<int, int>(dis[e[i].to], e[i].to));
  }
  if (!flow[t]) return 0;
  for (register int i = from[t]; i; i = from[e[i].from])
    e[i].caps -= flow[t], e[i ^ 1].caps += flow[t];
  return 1;
}
inline void work(int s, int t) {
  FLOW = 0;
  COST = 0;
  while (dj(s, t)) {
    FLOW += flow[t], COST += flow[t] * (dis[t] + h[t] - h[s]);
    Cost[FLOW] = COST;
  }
}
}  // namespace COSTFLOW
using namespace COSTFLOW;
double gt(int x) { return (double)(Cost[x] + k) / (double)x; }
inline double ask(int l, int r) {
  if (r - l <= 3) {
    double res = 1e18;
    for (register int i = l; i <= r; i++) res = min(res, gt(i));
    return res;
  }
  int la = (2 * l + r) / 3, lb = (l + 2 * r) / 3;
  return gt(la) < gt(lb) ? ask(l, lb) : ask(la, r);
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read(), z = read();
    ins(x, y, 1, z);
  }
  work(1, n);
  for (register int q = read(); q; q--)
    k = read(), printf("%.10lf\n", ask(1, FLOW));
  return 0;
}
