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;
long long ksm(long long a, long long b) {
  if (!b) return 1;
  long long ns = ksm(a, b >> 1);
  ns = ns * ns % 998244353;
  if (b & 1) ns = ns * a % 998244353;
  return ns;
}
namespace MCMF {
const int M = 5005, N = 55;
struct edge {
  int u, v, c, w;
  edge *next;
  edge *rev;
} p[M], *h[N];
int egcnt = 0;
void ade(int u, int v, int c, int w) {
  edge *n1 = &p[egcnt++];
  edge *n2 = &p[egcnt++];
  n1->u = u, n1->v = v, n1->c = c, n1->w = w;
  n2->u = v, n2->v = u, n2->c = 0, n2->w = -w;
  n1->next = h[u], h[u] = n1;
  n2->next = h[v], h[v] = n2;
  n1->rev = n2, n2->rev = n1;
}
int dis[N], s, t, inq[N];
edge *pre[N];
void init(int a, int b) {
  s = a, t = b;
  for (int i = 0; i < N; i++) h[i] = NULL;
}
vector<pair<int, int> > ans;
const int inf = 1e9 + 7;
void spfa() {
  int tflow = 0, tcost = 0;
  while (1) {
    for (int i = 0; i < N; i++) dis[i] = inf, inq[i] = 0;
    queue<int> g;
    dis[s] = 0, g.push(s), inq[s] = 1;
    while (!g.empty()) {
      int fr = g.front();
      g.pop();
      inq[fr] = 0;
      for (edge *p = h[fr]; p; p = p->next) {
        if (!p->c) continue;
        int ndis = p->w + dis[fr];
        if (ndis < dis[p->v]) {
          dis[p->v] = ndis, pre[p->v] = p;
          if (!inq[p->v]) inq[p->v] = 1, g.push(p->v);
        }
      }
    }
    if (dis[t] == inf) break;
    int pl = t, us = 0, uc = inf;
    while (pl != s) {
      us += pre[pl]->w;
      uc = min(uc, pre[pl]->c);
      pl = pre[pl]->u;
    }
    tflow += uc, tcost += us * uc;
    pl = t;
    while (pl != s) {
      pre[pl]->c -= uc;
      pre[pl]->rev->c += uc;
      pl = pre[pl]->u;
    }
    ans.push_back(make_pair(tflow, tcost));
  }
}
double check(int r) {
  double res = inf;
  for (auto v : ans) res = min(res, 1.0 * (v.second + r) / v.first);
  return res;
}
}  // namespace MCMF
int main() {
  int n, m;
  cin >> n >> m;
  MCMF::init(1, n);
  for (int i = 0; i < m; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    MCMF::ade(u, v, 1, w);
  }
  MCMF::spfa();
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    int x;
    scanf("%d", &x);
    double ans = MCMF::check(x);
    printf("%.10lf\n", ans);
  }
  return 0;
}