#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class C>
void mini(C &a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C &a4, C b4) {
  a4 = max(a4, b4);
}
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
class MinCostFlow {
  struct MCEdge {
    long long to, cost, flow;
    MCEdge *next;
  };
  const long long Infty = 1e9 + 100;
  long long N, Source, Sink;
  vector<long long> dist;
  vector<MCEdge *> prev, Edges;
  vector<vector<MCEdge *>> adjList;
  void spfa() {
    queue<long long> Q;
    vector<bool> onQueue(N);
    fill((dist).begin(), (dist).end(), Infty);
    Q.push(Source);
    onQueue[Source] = true;
    dist[Source] = 0;
    while (!Q.empty()) {
      long long v = Q.front();
      Q.pop();
      onQueue[v] = false;
      for (MCEdge *E : adjList[v]) {
        long long s = E->to;
        if (E->flow == 0) {
          continue;
        }
        long long newDist = dist[v] + E->cost;
        if (newDist < dist[s]) {
          dist[s] = newDist;
          prev[s] = E->next;
          if (!onQueue[s]) {
            Q.push(s);
            onQueue[s] = true;
          }
        }
      }
    }
  }
  long long reduce_cost() {
    for (long long v = (0); v <= ((long long)(N)-1); v++) {
      for (MCEdge *E : adjList[v]) {
        E->cost += dist[v] - dist[E->to];
      }
    }
    return dist[Sink];
  }
  void dijkstra_shortest_path() {
    fill((dist).begin(), (dist).end(), Infty);
    dist[Source] = 0;
    priority_queue<pair<long long, long long>> Q;
    Q.push(make_pair(0, Source));
    while (!Q.empty()) {
      long long dst = -Q.top().first, v = Q.top().second;
      Q.pop();
      if (dst != dist[v]) {
        continue;
      }
      for (MCEdge *E : adjList[v]) {
        long long s = E->to;
        if (!E->flow) {
          continue;
        }
        long long newDist = dist[v] + E->cost;
        if (newDist < dist[s]) {
          dist[s] = newDist;
          prev[s] = E->next;
          Q.push({-newDist, s});
        }
      }
    }
  }

 public:
  MinCostFlow() { N = 0; }
  MinCostFlow(long long _N) : N(_N), dist(_N), prev(_N), adjList(_N) {}
  ~MinCostFlow() {
    for (MCEdge *E : Edges) {
      delete E;
    }
  }
  void fit(long long size) {
    if (size > N) {
      N = size;
      dist.resize(size);
      prev.resize(size);
      adjList.resize(size);
    }
  }
  void add_edge(long long u, long long v, long long flow, long long cost) {
    fit(max(u, v) + 1);
    MCEdge *E1 = new MCEdge{v, cost, flow, 0}, *E2 = new MCEdge{u, -cost, 0, 0};
    Edges.push_back(E1);
    Edges.push_back(E2);
    E1->next = E2;
    E2->next = E1;
    adjList[u].push_back(E1);
    adjList[v].push_back(E2);
  }
  vector<long long> get_min_cost_flow(long long s, long long t) {
    fit(max(s, t) + 1);
    Source = s;
    Sink = t;
    spfa();
    if (dist[Sink] > Infty / 2) {
      return {0, 0};
    }
    long long sinkCost = reduce_cost();
    vector<long long> res;
    res.push_back(0);
    while (true) {
      dijkstra_shortest_path();
      if (dist[Sink] > Infty / 2) {
        break;
      }
      sinkCost += reduce_cost();
      long long maxSend = Infty;
      for (long long v = Sink; v != Source; v = prev[v]->to) {
        maxSend = min(maxSend, prev[v]->next->flow);
      }
      for (long long v = Sink; v != Source; v = prev[v]->to) {
        MCEdge *E1 = prev[v], *E2 = E1->next;
        E1->flow += maxSend;
        E2->flow -= maxSend;
      }
      for (long long i = (0); i <= ((long long)(maxSend)-1); i++) {
        res.push_back(res.back() + sinkCost);
      }
    }
    return res;
  }
};
long long n, m;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  if (0) cout << fixed << setprecision(6);
  cin >> n >> m;
  MinCostFlow flow;
  for (long long i = (0); i <= ((long long)(m)-1); i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    a--;
    b--;
    flow.add_edge(a, b, 1, c);
  }
  vector<long long> pom = flow.get_min_cost_flow(0, n - 1);
  long long q;
  cin >> q;
  for (long long i = (0); i <= ((long long)(q)-1); i++) {
    long long x;
    cin >> x;
    long double res = 1e18;
    for (long long j = (0); j <= ((long long)(((long long)(pom).size())) - 1);
         j++)
      if (j) {
        mini(res, ((long double)(pom[j] + x)) / j);
      }
    cout << res << "\n";
  }
}
