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 N = 3000 + 10;
namespace MCMF {
const int INF = 0x3f3f3f3f;
int cnt = 1, S, T, pre[N], id[N], b[N];
int dis[N], h[N];
bool vis[N];
struct node {
  int v, c;
  int w;
  int nex;
} e[N * 4];
void addedge(int u, int v, int c, int w) {
  e[++cnt] = node{v, c, w, b[u]};
  b[u] = cnt;
  e[++cnt] = node{u, 0, -w, b[v]};
  b[v] = cnt;
}
void init(int n) {
  cnt = 1;
  S = 0, T = n - 1;
  for (int i = 0; i < n; i++) b[i] = -1;
}
vector<int> mcmf() {
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      Q;
  int maxflow = 0;
  int cost = 0;
  vector<int> ans;
  while (1) {
    for (int i = S; i <= T; i++) dis[i] = INF;
    Q.push(pair<int, int>{0, S});
    dis[S] = 0;
    while (!Q.empty()) {
      pair<int, int> q = Q.top();
      Q.pop();
      int now = q.second;
      if (dis[now] < q.first) continue;
      for (int i = b[now]; i != -1; i = e[i].nex) {
        if (e[i].c < 0) continue;
        if (e[i].c > 0 &&
            dis[e[i].v] > dis[now] + e[i].w + h[now] - h[e[i].v]) {
          dis[e[i].v] = dis[now] + e[i].w + h[now] - h[e[i].v];
          pre[e[i].v] = now;
          id[e[i].v] = i;
          Q.push(pair<int, int>{dis[e[i].v], e[i].v});
        }
      }
    }
    if (dis[T] == INF) break;
    int flow = 1;
    for (int i = T; i != S; i = pre[i]) flow = min(flow, e[id[i]].c);
    maxflow += flow;
    cost += flow * (dis[T] - h[S] + h[T]);
    ans.push_back(flow * (dis[T] - h[S] + h[T]));
    for (int i = T; i != S; i = pre[i]) {
      e[id[i]].c -= flow;
      e[id[i] ^ 1].c += flow;
    }
    for (int i = S; i <= T; ++i) {
      h[i] += dis[i];
    }
  }
  return ans;
}
};  // namespace MCMF
int main() {
  ios::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  MCMF::init(n);
  while (m--) {
    int u, v, w;
    cin >> u >> v >> w;
    MCMF::addedge(u - 1, v - 1, 1, w);
  }
  vector<int> res = MCMF::mcmf();
  vector<double> vec = {0};
  for (int i = 1; i < (int)res.size(); i++) {
    vec.push_back(vec.back() + 1.0 * (res[i] - res[i - 1]) * i);
  }
  int q;
  cin >> q;
  while (q--) {
    int x;
    cin >> x;
    int pos = upper_bound(vec.begin(), vec.end(), x) - vec.begin() - 1;
    cout << fixed << setprecision(10);
    cout << res[pos] + (x - vec[pos]) / (pos + 1) << endl;
  }
}