#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int t, f, v, next;
  Edge() {}
  Edge(int a, int b, int c, int d) : t(a), f(b), v(c), next(d) {}
};
Edge e[1000005];
int head[55], vs, vt, tot = -1;
inline void addEdge(int x, int y, int z, int v) {
  e[++tot] = Edge(y, z, v, head[x]);
  head[x] = tot;
  e[++tot] = Edge(x, 0, -v, head[y]);
  head[y] = tot;
}
struct Point {
  long long x, y;
  Point() {}
  Point(long long a, long long b) : x(a), y(b) {}
  Point operator-(Point b) { return Point(x - b.x, y - b.y); }
};
inline long long cross(Point x, Point y) { return x.x * y.y - x.y * y.x; }
inline double calc(Point x, long long k) { return (double)(k + x.y) / x.x; }
Point p[55], st[55];
int sz;
void gethull() {
  int top = 1;
  st[1] = Point(0, 0);
  for (int i = 1; i <= sz; i++) {
    while (top > 1 && cross(p[i] - st[top], st[top] - st[top - 1]) >= 0) top--;
    st[++top] = p[i];
  }
  sz = top - 1;
  for (int i = 1; i <= sz; i++) p[i] = st[i + 1];
}
double query(long long k) {
  int l = 1, r = sz;
  while (r - l > 2) {
    int m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
    if (calc(p[m1], k) <= calc(p[m2], k))
      r = m2;
    else
      l = m1;
  }
  double ans = 1e18;
  for (int i = l; i <= r; i++) ans = min(ans, calc(p[i], k));
  return ans;
}
namespace Flow {
int dis[55], cur[55];
bool in[55];
queue<int> q;
bool spfa() {
  memset(in, 0, sizeof(in));
  memset(dis, 0x3f, sizeof(dis));
  dis[vs] = 0;
  in[vs] = 1;
  q.push(vs);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    in[x] = 0;
    cur[x] = head[x];
    for (int i = head[x]; i != -1; i = e[i].next)
      if (e[i].f && dis[x] + e[i].v < dis[e[i].t]) {
        int u = e[i].t;
        dis[u] = dis[x] + e[i].v;
        if (!in[u]) {
          in[u] = 1;
          q.push(u);
        }
      }
  }
  return dis[vt] < 0x3f3f3f3f;
}
int vis[55], cnt;
int dfs(int x, int a) {
  if (x == vt || !a) return a;
  vis[x] = cnt;
  int ans = 0;
  for (int &i = cur[x]; i != -1; i = e[i].next)
    if (e[i].f && vis[e[i].t] < cnt && dis[x] + e[i].v == dis[e[i].t]) {
      int u = e[i].t;
      int f = dfs(u, min(a, e[i].f));
      if (f) {
        e[i].f -= f;
        e[i ^ 1].f += f;
        ans += f;
        a -= f;
        if (!a) break;
      }
    }
  return ans;
}
void msmf() {
  long long s1 = 0, s2 = 0;
  while (spfa()) {
    int t;
    do {
      cnt++;
      t = dfs(vs, 0x3f3f3f3f);
      s1 += t;
      s2 += (long long)t * dis[vt];
    } while (t);
    p[++sz] = Point(s1, s2);
  }
}
}  // namespace Flow
int main() {
  memset(head, 255, sizeof(head));
  int n, m;
  scanf("%d%d", &n, &m);
  vs = 1;
  vt = n;
  for (int i = 1; i <= m; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    addEdge(x, y, 1, z);
  }
  Flow::msmf();
  gethull();
  int k;
  scanf("%d", &k);
  for (int i = 1; i <= k; i++) {
    int x;
    scanf("%d", &x);
    printf("%.10f\n", query(x));
  }
  return 0;
}
