Problem: Farmer John is obsessed with making Bessie exercise more!

Bessie is out grazing on the farm, which consists of n fields connected by m directed roads. Each road takes some time w_i to cross. She is currently at field 1 and will return to her home at field n at the end of the day.

Farmer John has plans to increase the time it takes to cross certain roads. He can increase the time it takes to cross each road by a nonnegative amount, but the total increase cannot exceed x_i for the i-th plan. 

Determine the maximum he can make the shortest path from 1 to n for each of the q independent plans.

Input

The first line contains integers n and m (2 ≤ n ≤ 50, 1 ≤ m ≤ n ⋅ (n-1)) — the number of fields and number of roads, respectively.

Each of the following m lines contains 3 integers, u_i, v_i, and w_i (1 ≤ u_i, v_i ≤ n, 1 ≤ w_i ≤ 10^6), meaning there is an road from field u_i to field v_i that takes w_i time to cross.

It is guaranteed that there exists a way to get to field n from field 1. It is guaranteed that the graph does not contain self-loops or parallel edges. It is possible to have a road from u to v and a road from v to u.

The next line contains a single integer q (1 ≤ q ≤ 10^5), the number of plans.

Each of the following q lines contains a single integer x_i, the query (0 ≤ x_i ≤ 10^5).

Output

For each query, output the maximum Farmer John can make the shortest path if the total increase does not exceed x_i.

Your answer is considered correct if its absolute or relative error does not exceed 10^{-6}.

Formally, let your answer be a, and the jury's answer be b. Your answer is accepted if and only if \frac{|a - b|}{max{(1, |b|)}} ≤ 10^{-6}.

Example

Input


3 3
1 2 2
2 3 2
1 3 3
5
0
1
2
3
4


Output


3.0000000000
4.0000000000
4.5000000000
5.0000000000
5.5000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using uint = unsigned int;
template <class T>
using V = vector<T>;
template <class T>
using VV = vector<vector<T>>;
template <class T, class U>
void chmax(T& x, U y) {
  if (x < y) x = y;
}
template <class T, class U>
void chmin(T& x, U y) {
  if (y < x) x = y;
}
template <class T>
void mkuni(V<T>& v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
}
template <class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& p) {
  return o << "(" << p.first << "," << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& vc) {
  o << "{";
  for (const T& v : vc) o << v << ",";
  o << "}";
  return o;
}
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
struct MinCostFlow {
  using C = ll;
  using D = ll;
  const D inf = 1e18;
  struct edge {
    int to;
    C cap;
    D cost;
    int rev;
    edge(int to_, C cap_, D cost_, int rev_)
        : to(to_), cap(cap_), cost(cost_), rev(rev_) {}
  };
  int N;
  VV<edge> G;
  V<D> h;
  V<D> dist;
  V<int> prevv, preve;
  MinCostFlow(int N_) : N(N_) {
    G.resize(N);
    h.resize(N);
    dist.resize(N);
    prevv.resize(N);
    preve.resize(N);
  }
  void add_edge(int from, int to, C cap, D cost) {
    edge e1(to, cap, cost, (int)G[to].size());
    edge e2(from, 0, -cost, (int)G[from].size());
    G[from].push_back(e1);
    G[to].push_back(e2);
  }
  V<pair<C, D>> min_cost_flow_slopes(int s, int t) {
    V<pair<C, D>> res;
    h = V<D>(N);
    while (true) {
      using P = pair<D, int>;
      priority_queue<P, vector<P>, greater<P>> que;
      dist = V<D>(N, inf);
      dist[s] = 0;
      que.push(P(0, s));
      while (!que.empty()) {
        P p = que.top();
        que.pop();
        int v = p.second;
        if (dist[v] < p.first) continue;
        for (int i = 0; i < (int)G[v].size(); i++) {
          edge& e = G[v][i];
          if (e.cap > 0 && dist[e.to] > dist[v] + e.cost + h[v] - h[e.to]) {
            dist[e.to] = dist[v] + e.cost + h[v] - h[e.to];
            prevv[e.to] = v;
            preve[e.to] = i;
            que.push(P(dist[e.to], e.to));
          }
        }
      }
      if (dist[t] == inf) break;
      for (int v = 0; v < int(N); v++) h[v] += dist[v];
      C f = inf;
      for (int v = t; v != s; v = prevv[v]) {
        chmin(f, G[prevv[v]][preve[v]].cap);
      }
      res.emplace_back(f, h[t]);
      for (int v = t; v != s; v = prevv[v]) {
        edge& e = G[prevv[v]][preve[v]];
        e.cap -= f;
        G[v][e.rev].cap += f;
      }
    }
    return res;
  }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int N, M;
  cin >> N >> M;
  MinCostFlow MCF(N);
  for (int i = 0; i < int(M); i++) {
    int x, y, w;
    cin >> x >> y >> w;
    x--, y--;
    MCF.add_edge(x, y, 1, w);
  }
  auto slope = MCF.min_cost_flow_slopes(0, N - 1);
  void(0);
  using P = pair<ll, ll>;
  V<P> ps;
  {
    ll x = 0, y = 0;
    for (auto xy : slope) {
      x += xy.first, y += xy.first * xy.second;
      ps.emplace_back(x, y);
    }
  }
  void(0);
  int K = ps.size();
  int Q;
  cin >> Q;
  V<ll> D(Q);
  for (int i = 0; i < int(Q); i++) cin >> D[i];
  V<int> idx(Q);
  iota(idx.begin(), idx.end(), 0);
  sort(idx.begin(), idx.end(), [&](int l, int r) { return D[l] < D[r]; });
  V<double> ans(Q);
  int it = 0;
  auto val = [&](int i, double d) {
    return double(ps[i].second + d) / ps[i].first;
  };
  for (int i : idx) {
    while (it != K - 1 && val(it, D[i]) > val(it + 1, D[i])) it++;
    ans[i] = val(it, D[i]);
  }
  for (double d : ans) cout << d << '\n';
}