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;
int n, m;
int info[55], Prev[55 * 55 * 4], to[55 * 55 * 4], cap[55 * 55 * 4],
    cst[55 * 55 * 4], cnt_e = 1;
void Node(int u, int v, int c, int ct) {
  Prev[++cnt_e] = info[u], info[u] = cnt_e, to[cnt_e] = v, cst[cnt_e] = ct,
  cap[cnt_e] = c;
}
void Line(int u, int v, int c, int ct) {
  Node(u, v, c, ct), Node(v, u, 0, -ct);
}
bool vis[55];
int h[55], S, T;
bool SPFA() {
  static queue<int> q;
  static int inq[55];
  memset(h, -0x3f, sizeof h);
  q.push(T);
  h[T] = 0;
  for (int u; !q.empty();) {
    u = q.front(), q.pop();
    for (int i = info[u], v; i; i = Prev[i])
      if (cap[i ^ 1] && h[v = to[i]] < h[u] + cst[i ^ 1])
        h[v] = h[u] + cst[i ^ 1], (!inq[v]) && (q.push(v), inq[v] = 1);
    inq[u] = 0;
  }
  return h[S] != h[0];
}
int dist = 0;
int aug(int u, int mx) {
  if (u == T) return dist += mx * h[S], mx;
  int st = mx, inc;
  vis[u] = 1;
  for (int i = info[u], v; i; i = Prev[i])
    if (cap[i] && h[v = to[i]] + cst[i] == h[u] && !vis[v] &&
        (inc = aug(v, min(st, cap[i])))) {
      st -= inc, cap[i] -= inc, cap[i ^ 1] += inc;
      if (!st) return vis[u] = 0, mx - st;
    }
  return vis[u] = 0, mx - st;
}
int cs[55];
int main() {
  scanf("%d%d", &n, &m);
  S = 1, T = n;
  for (int i = (1), LIM = (m); i <= LIM; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    Line(u, v, 1, -w);
  }
  int stm = 0;
  for (; SPFA();) {
    stm += aug(S, 1);
    cs[stm] = dist;
  }
  int q;
  for (scanf("%d", &q); q--;) {
    double x;
    scanf("%lf", &x);
    double ans = 0x3f3f3f3f;
    for (int i = (1), LIM = (stm); i <= LIM; i++)
      ans = min(ans, (x - cs[i]) / i);
    printf("%.10lf\n", ans);
  }
}