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;
std::mt19937 rng(
    (int)std::chrono::steady_clock::now().time_since_epoch().count());
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename T_container, typename T = typename enable_if<
                                    !is_same<T_container, string>::value,
                                    typename T_container::value_type>::type>
ostream &operator<<(ostream &os, const T_container &v) {
  os << '{';
  string sep;
  for (const T &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << ' ' << H;
  dbg_out(T...);
}
long long modpow(long long b, long long e, long long mod) {
  long long ans = 1;
  for (; e; b = b * b % mod, e /= 2)
    if (e & 1) ans = ans * b % mod;
  return ans;
}
namespace mcmf {
struct edge {
  int dest, cap, re, cost, flow;
};
const int MAXV = 112345;
const long long infll = 0x3f3f3f3f3f3f3f3fLL;
const int inf = 0x3f3f3f3f;
int n, s, t, p[MAXV], e_used[MAXV];
bool in_queue[MAXV];
long long d[MAXV];
vector<vector<edge>> graph;
void init(int _n, int _s, int _t) {
  n = _n, s = _s, t = _t;
  graph = vector<vector<edge>>(n + 1);
}
void put_edge(int u, int v, int cap, int cost) {
  graph[u].push_back({v, cap, (int)graph[v].size(), cost, 0});
  graph[v].push_back({u, 0, (int)graph[u].size() - 1, -cost, 0});
}
bool spfa() {
  memset(in_queue, 0, sizeof(bool) * (n + 1));
  memset(d, 0x3f, sizeof(long long) * (n + 1));
  queue<int> q;
  d[s] = 0;
  p[s] = s;
  q.push(s);
  while (!q.empty()) {
    int a = q.front();
    q.pop();
    in_queue[a] = false;
    for (int i = 0; i < graph[a].size(); i++) {
      edge &e = graph[a][i];
      if (e.cap - e.flow > 0 && d[e.dest] > d[a] + e.cost) {
        d[e.dest] = d[a] + e.cost;
        p[e.dest] = a;
        e_used[e.dest] = i;
        if (!in_queue[e.dest]) q.push(e.dest);
        in_queue[e.dest] = true;
      }
    }
  }
  return d[t] < infll;
}
vector<long long> Z;
pair<long long, long long> mincost_maxflow() {
  pair<long long, long long> retv = pair<long long, long long>(0, 0);
  while (spfa()) {
    int x = inf;
    for (int i = t; p[i] != i; i = p[i])
      x = min(x, graph[p[i]][e_used[i]].cap - graph[p[i]][e_used[i]].flow);
    for (int i = t; p[i] != i; i = p[i])
      graph[p[i]][e_used[i]].flow += x,
          graph[i][graph[p[i]][e_used[i]].re].flow -= x;
    retv.first += x;
    retv.second += x * d[t];
    Z.push_back(retv.second);
  }
  return retv;
}
}  // namespace mcmf
void solve() {
  int n, m;
  cin >> n >> m;
  mcmf::init(n, 1, n);
  for (int i = 0; i < m; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    mcmf::put_edge(u, v, 1, w);
  }
  mcmf::mincost_maxflow();
  int q;
  cin >> q;
  while (q--) {
    double p = 1e18;
    int x;
    cin >> x;
    int ct = 0;
    for (auto w : mcmf::Z) {
      p = min(p, (1.00 * x + 1.00 * w) / (1.00 * (++ct)));
    }
    cout << fixed << setprecision(6) << p << endl;
  }
}
int32_t main() { solve(); }