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;
const int MOD = 1000000007;
const long long INF = 1e18;
const int MX = 200005;
const long double PI = 4 * atan((long double)1);
template <class T>
void ckmin(T& a, T b) {
  a = min(a, b);
}
template <class T>
void ckmax(T& a, T b) {
  a = max(a, b);
}
template <class T>
T invGeneral(T a, T b) {
  a %= b;
  if (a == 0) return b == 1 ? 0 : -1;
  T x = invGeneral(b, a);
  return x == -1 ? -1 : ((1 - (long long)b * x) / a + b) % b;
}
template <class T>
struct modular {
  T val;
  explicit operator T() const { return val; }
  modular() { val = 0; }
  template <class U>
  modular(const U& v) {
    val = (-MOD <= v && v <= MOD) ? v : v % MOD;
    if (val < 0) val += MOD;
  }
  friend ostream& operator<<(ostream& os, const modular& a) {
    return os << a.val;
  }
  friend bool operator==(const modular& a, const modular& b) {
    return a.val == b.val;
  }
  friend bool operator!=(const modular& a, const modular& b) {
    return !(a == b);
  }
  modular operator-() const { return modular(-val); }
  modular& operator+=(const modular& m) {
    if ((val += m.val) >= MOD) val -= MOD;
    return *this;
  }
  modular& operator-=(const modular& m) {
    if ((val -= m.val) < 0) val += MOD;
    return *this;
  }
  modular& operator*=(const modular& m) {
    val = (long long)val * m.val % MOD;
    return *this;
  }
  friend modular exp(modular a, long long p) {
    modular ans = 1;
    for (; p; p /= 2, a *= a)
      if (p & 1) ans *= a;
    return ans;
  }
  friend modular inv(const modular& a) {
    auto i = invGeneral(a.val, MOD);
    assert(i != -1);
    return i;
  }
  modular& operator/=(const modular& m) { return (*this) *= inv(m); }
  friend modular operator+(modular a, const modular& b) { return a += b; }
  friend modular operator-(modular a, const modular& b) { return a -= b; }
  friend modular operator*(modular a, const modular& b) { return a *= b; }
  friend modular operator/(modular a, const modular& b) { return a /= b; }
};
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
template <class T>
T poll(pqg<T>& x) {
  T y = x.top();
  x.pop();
  return y;
}
template <int SZ>
struct mcf {
  struct Edge {
    int v, rev;
    long long flow, cap, cost;
  };
  vector<Edge> adj[SZ];
  void addEdge(int u, int v, long long cap, long long cost) {
    Edge a{v, (int)adj[v].size(), 0, cap, cost},
        b{u, (int)adj[u].size(), 0, 0, -cost};
    adj[u].push_back(a), adj[v].push_back(b);
  }
  int ST, EN;
  pair<int, int> pre[SZ];
  pair<long long, long long> cost[SZ];
  long long totFlow, totCost, curCost;
  void reweight() {
    for (int i = 0; i < (SZ); i++)
      for (auto& p : adj[i]) p.cost += cost[i].first - cost[p.v].first;
  }
  bool spfa() {
    for (int i = 0; i < (SZ); i++) cost[i] = {INF, 0};
    cost[ST] = {0, INF};
    pqg<pair<long long, int>> todo;
    todo.push({0, ST});
    while ((int)todo.size()) {
      auto x = poll(todo);
      if (x.first > cost[x.second].first) continue;
      for (auto& a : adj[x.second])
        if (x.first + a.cost < cost[a.v].first && a.flow < a.cap) {
          pre[a.v] = {x.second, a.rev};
          cost[a.v] = {x.first + a.cost,
                       min(a.cap - a.flow, cost[x.second].second)};
          todo.push({cost[a.v].first, a.v});
        }
    }
    curCost += cost[EN].first;
    return cost[EN].second;
  }
  void backtrack() {
    auto first = 1;
    totFlow += first;
    totCost += curCost * first;
    for (int x = EN; x != ST; x = pre[x].first) {
      adj[x][pre[x].second].flow -= first;
      adj[pre[x].first][adj[x][pre[x].second].rev].flow += first;
    }
  }
};
mcf<201> m;
int N, M, q, second, t;
double ans[200005], x[200005];
int main() {
  scanf("%d%d", &N, &M);
  second = 1, t = N;
  for (int i = 1; i <= M; i++) {
    int u, v, d;
    scanf("%d%d%d", &u, &v, &d);
    m.addEdge(u, v, 1, d);
  }
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) ans[i] = INF;
  for (int i = 1; i <= q; i++) scanf("%lf", &x[i]);
  m.ST = second, m.EN = t;
  m.totFlow = m.totCost = m.curCost = 0;
  m.spfa();
  while (1) {
    m.reweight();
    if (!m.spfa()) break;
    m.backtrack();
    for (int i = 1; i <= q; i++)
      ckmin(ans[i], (double)(m.totCost + x[i]) / m.totFlow);
  }
  for (int i = 1; i <= q; i++) printf("%.12lf\n", ans[i]);
  return 0;
}