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;
template <class T>
int chkmax(T& a, T b) {
  if (b > a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
int chkmin(T& a, T b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class iterator>
void output(iterator begin, iterator end, ostream& out = cerr) {
  while (begin != end) {
    out << (*begin) << " ";
    begin++;
  }
  out << endl;
}
template <class T>
void output(T x, ostream& out = cerr) {
  output(x.begin(), x.end(), out);
}
void fast_io() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int INF = 1e9 + 228;
struct edge {
  int v, cap, cost, flow;
  edge(int _v, int _cap, int _cost) : v(_v), cap(_cap), cost(_cost), flow(0) {}
};
struct mincost {
  int n, s, t;
  vector<edge> e;
  vector<vector<int> > g;
  vector<int> d, p, in_queue;
  queue<int> q;
  void init(int _n, int _s, int _t) {
    n = _n;
    s = _s;
    t = _t;
    g.resize(n);
    d.resize(n);
    in_queue.resize(n);
    p.resize(n);
  }
  void add_edge(int u, int v, int cap, int cost) {
    g[u].push_back(e.size());
    e.emplace_back(v, cap, cost);
    g[v].emplace_back(e.size());
    e.emplace_back(u, 0, -cost);
  }
  int push_flow() {
    fill(p.begin(), p.end(), -1);
    fill(d.begin(), d.end(), INF);
    fill(in_queue.begin(), in_queue.end(), 0);
    d[s] = 0;
    q.push(s);
    in_queue[s] = 1;
    while (!q.empty()) {
      int v = q.front();
      q.pop();
      in_queue[v] = 0;
      for (auto en : g[v]) {
        int v1 = e[en].v;
        if (e[en].flow < e[en].cap && chkmin(d[v1], d[v] + e[en].cost)) {
          p[v1] = en;
          if (in_queue[v1] == 0) {
            q.push(v1);
            in_queue[v1] = 1;
          }
        }
      }
    }
    if (p[t] == -1) {
      return INF;
    }
    int v = t, res = 0;
    while (v != s) {
      int en = p[v];
      res += e[en].cost;
      e[en].flow += 1;
      e[en ^ 1].flow -= 1;
      v = e[en ^ 1].v;
    }
    return res;
  }
  vector<int> solve() {
    vector<int> res;
    while (true) {
      int cur_res = push_flow();
      if (cur_res == INF) {
        break;
      }
      res.push_back(cur_res);
    }
    return res;
  }
};
mincost solver;
int n, m;
vector<pair<long long, long long> > points;
signed main() {
  fast_io();
  cin >> n >> m;
  solver.init(n, 0, n - 1);
  for (int i = 0; i < m; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    a--;
    b--;
    solver.add_edge(a, b, 1, c);
  }
  vector<int> costs = solver.solve();
  long long C = 0;
  for (long long f = 0; f < (int)costs.size(); ++f) {
    points.emplace_back(f * costs[f] - C, costs[f]);
    C += costs[f];
  }
  long long F = costs.size();
  points.emplace_back(F * INF - C, INF);
  int q;
  cin >> q;
  cout << setprecision(10) << fixed;
  for (int i = 0; i < q; ++i) {
    long long x;
    cin >> x;
    auto it =
        prev(lower_bound(points.begin(), points.end(), make_pair(x + 1, 0LL)));
    auto it1 = next(it);
    long double y = (long double)it->second +
                    (long double)(it1->second - it->second) *
                        (long double)((long double)x - it->first) /
                        (long double)(it1->first - it->first);
    cout << y << "\n";
  }
}