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 std::max;
using std::min;
const int inf = 0x3f3f3f3f, Inf = 0x7fffffff;
const long long INF = 0x3f3f3f3f3f3f3f3f;
std::mt19937 rnd(std::chrono::steady_clock::now().time_since_epoch().count());
template <typename _Tp>
_Tp gcd(const _Tp &a, const _Tp &b) {
  return (!b) ? a : gcd(b, a % b);
}
template <typename _Tp>
inline _Tp abs(const _Tp &a) {
  return a >= 0 ? a : -a;
}
template <typename _Tp>
inline void chmax(_Tp &a, const _Tp &b) {
  (a < b) && (a = b);
}
template <typename _Tp>
inline void chmin(_Tp &a, const _Tp &b) {
  (b < a) && (a = b);
}
template <typename _Tp>
inline void read(_Tp &x) {
  char ch(getchar());
  bool f(false);
  while (!isdigit(ch)) f |= ch == 45, ch = getchar();
  x = ch & 15, ch = getchar();
  while (isdigit(ch)) x = (((x << 2) + x) << 1) + (ch & 15), ch = getchar();
  f && (x = -x);
}
template <typename _Tp, typename... Args>
inline void read(_Tp &t, Args &...args) {
  read(t);
  read(args...);
}
inline int read_str(char *s) {
  char ch(getchar());
  while (ch == ' ' || ch == '\r' || ch == '\n') ch = getchar();
  char *tar = s;
  *tar = ch, ch = getchar();
  while (ch != ' ' && ch != '\r' && ch != '\n' && ch != EOF)
    *(++tar) = ch, ch = getchar();
  return tar - s + 1;
}
const int N = 55;
struct edge {
  int v, nxt, w, cost;
} c[N * N << 2];
int front[N], edge_cnt = -1;
inline void addedge(int u, int v, int w, int cost) {
  c[++edge_cnt] = (edge){v, front[u], w, cost}, front[u] = edge_cnt;
  c[++edge_cnt] = (edge){u, front[v], 0, -cost}, front[v] = edge_cnt;
}
int dep[N], cur[N], S, T, _q[N * N], _l, _r, pre[N];
bool inq[N];
bool bfs() {
  memset(dep, 63, sizeof(dep));
  dep[S] = 0, _q[_l = _r = 1] = S;
  while (_l != _r + 1) {
    int x = _q[_l++];
    inq[x] = false;
    for (int i = front[x]; ~i; i = c[i].nxt) {
      int v = c[i].v;
      if (c[i].w && dep[v] > dep[x] + c[i].cost) {
        dep[v] = dep[x] + c[i].cost, pre[v] = i;
        if (!inq[v]) _q[++_r] = v, inq[v] = true;
      }
    }
  }
  return dep[T] < inf;
}
int C[N], pos;
void MCMF() {
  int ans = 0;
  while (bfs()) {
    int cur = T;
    while (cur != S) {
      int id = pre[cur];
      --c[id].w, ++c[id ^ 1].w;
      ans += c[id].cost;
      cur = c[id ^ 1].v;
    }
    C[++pos] = ans;
  }
  for (int i = 1; i <= pos; ++i) fprintf(stderr, "%d%c", C[i], " \n"[i == pos]);
}
int main() {
  memset(front, 255, sizeof(front));
  int n, m;
  read(n, m);
  int x, y, z;
  S = 1, T = n;
  for (int i = 1; i <= m; ++i) read(x, y, z), addedge(x, y, 1, z);
  MCMF();
  int _;
  read(_);
  while (_--) {
    read(x);
    double ans = 1e18;
    for (int i = 1; i <= pos; ++i) chmin(ans, (double)(x + C[i]) / i);
    printf("%.8lf\n", ans);
  }
  return 0;
}