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 inf = 1e9;
inline void gmx(int &x, int y) {
  if (x < y) x = y;
}
inline void gmn(int &x, int y) {
  if (x > y) x = y;
}
inline int read() {
  char c = getchar();
  int z = 0, f = 1;
  while (c != '-' && (c > '9' || c < '0')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') z = (z << 1) + (z << 3) + c - '0', c = getchar();
  return z * f;
}
const int N = 1e5 + 5, M = 3e5 + 5;
double Cost[N], k;
int m;
namespace COSTFLOW {
int n, FLOW, COST, head[N], cnt = 1;
struct EDGE {
  int from, to, nex, caps, f;
} e[M];
inline void ins(int x, int y, int z, int w) {
  e[++cnt] = (EDGE){x, y, head[x], z, w};
  head[x] = cnt;
  e[++cnt] = (EDGE){y, x, head[y], 0, -w};
  head[y] = cnt;
}
int h[N], dis[N], from[N], flow[N], vis[N];
inline void init(int _n) { n = _n; }
bool dj(int s, int t) {
  for (int i = 1; i <= n; i++)
    h[i] = min(h[i] + dis[i], inf), dis[i] = inf, vis[i] = 0, flow[i] = 0;
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  dis[s] = 0;
  flow[s] = inf;
  q.push(pair<int, int>(0, s));
  while (!q.empty()) {
    int x = q.top().second;
    q.pop();
    if (vis[x]) continue;
    vis[x] = 1;
    for (register int i = head[x]; i; i = e[i].nex)
      if (e[i].caps > 0 && dis[e[i].to] > dis[x] + e[i].f + h[x] - h[e[i].to])
        dis[e[i].to] = dis[x] + e[i].f + h[x] - h[e[i].to],
        flow[e[i].to] = min(flow[x], e[i].caps), from[e[i].to] = i,
        q.push(pair<int, int>(dis[e[i].to], e[i].to));
  }
  if (!flow[t]) return 0;
  for (register int i = from[t]; i; i = from[e[i].from])
    e[i].caps -= flow[t], e[i ^ 1].caps += flow[t];
  return 1;
}
inline void work(int s, int t) {
  FLOW = 0;
  COST = 0;
  while (dj(s, t)) {
    FLOW += flow[t], COST += flow[t] * (dis[t] + h[t] - h[s]);
    Cost[FLOW] = COST;
  }
}
}  // namespace COSTFLOW
using namespace COSTFLOW;
double gt(int x) { return (double)(Cost[x] + k) / (double)x; }
inline double ask(int l, int r) {
  if (r - l <= 3) {
    double res = 1e18;
    for (register int i = l; i <= r; i++) res = min(res, gt(i));
    return res;
  }
  int la = (2 * l + r) / 3, lb = (l + 2 * r) / 3;
  return gt(la) < gt(lb) ? ask(l, lb) : ask(la, r);
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read(), z = read();
    ins(x, y, 1, z);
  }
  work(1, n);
  for (register int q = read(); q; q--)
    k = read(), printf("%.10lf\n", ask(1, FLOW));
  return 0;
}