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;
template <typename _T>
inline void read(_T &f) {
  f = 0;
  _T fu = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') {
      fu = -1;
    }
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    f = (f << 3) + (f << 1) + (c & 15);
    c = getchar();
  }
  f *= fu;
}
template <typename T>
void print(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x < 10)
    putchar(x + 48);
  else
    print(x / 10), putchar(x % 10 + 48);
}
template <typename T>
void print(T x, char t) {
  print(x);
  putchar(t);
}
const int N = 55, INF = 0x7fffffff;
struct edge_t {
  int u, v, next, cap, flow, cost;
} G[N * N * 2];
int head[N], dis[N], maxflow[N], fr[N], used[N], _dis[N], _flow[N], _must[N];
int n, m, q, tot = 1, ans1, ans2, len;
inline void addedge(int u, int v, int cap, int cost) {
  G[++tot] = (edge_t){u, v, head[u], cap, 0, cost}, head[u] = tot;
  G[++tot] = (edge_t){v, u, head[v], 0, 0, -cost}, head[v] = tot;
}
int spfa() {
  memset(dis, 0x7f, sizeof(dis));
  queue<int> q;
  dis[1] = 0;
  used[1] = 1;
  maxflow[1] = INF;
  q.push(1);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    used[u] = 0;
    for (int i = head[u]; i; i = G[i].next) {
      int v = G[i].v;
      if (G[i].cap > G[i].flow && dis[v] > dis[u] + G[i].cost) {
        dis[v] = dis[u] + G[i].cost;
        fr[v] = i;
        maxflow[v] = min(maxflow[u], G[i].cap - G[i].flow);
        if (!used[v]) {
          used[v] = 1;
          q.push(v);
        }
      }
    }
  }
  return dis[n] != 0x7f7f7f7f;
}
void solve() {
  int tmp = n;
  while (tmp != 1) {
    int i = fr[tmp];
    G[i].flow += maxflow[n];
    G[i ^ 1].flow -= maxflow[n];
    tmp = G[i].u;
  }
  ans1 += maxflow[n];
  ans2 += maxflow[n] * dis[n];
}
int main() {
  read(n);
  read(m);
  for (int i = 1; i <= m; i++) {
    int u, v, w;
    read(u);
    read(v);
    read(w);
    addedge(u, v, 1, w);
  }
  while (spfa()) {
    solve();
    ++len;
    _dis[len] = dis[n];
    _flow[len] = ans1;
    _must[len] = 1ll * ans1 * dis[n] - ans2;
  }
  read(q);
  while (q--) {
    int x;
    read(x);
    double minn = 1e18;
    for (int i = 1; i <= len; i++)
      if (x >= _must[i])
        minn = min(minn, _dis[i] + (double)(x - _must[i]) / _flow[i]);
    printf("%.10lf\n", minn);
  }
  return 0;
}