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;
struct Edge {
  int t, f, v, next;
  Edge() {}
  Edge(int a, int b, int c, int d) : t(a), f(b), v(c), next(d) {}
};
Edge e[1000005];
int head[55], vs, vt, tot = -1;
inline void addEdge(int x, int y, int z, int v) {
  e[++tot] = Edge(y, z, v, head[x]);
  head[x] = tot;
  e[++tot] = Edge(x, 0, -v, head[y]);
  head[y] = tot;
}
struct Point {
  long long x, y;
  Point() {}
  Point(long long a, long long b) : x(a), y(b) {}
  Point operator-(Point b) { return Point(x - b.x, y - b.y); }
};
inline long long cross(Point x, Point y) { return x.x * y.y - x.y * y.x; }
inline double calc(Point x, long long k) { return (double)(k + x.y) / x.x; }
Point p[55], st[55];
int sz;
void gethull() {
  int top = 1;
  st[1] = Point(0, 0);
  for (int i = 1; i <= sz; i++) {
    while (top > 1 && cross(p[i] - st[top], st[top] - st[top - 1]) >= 0) top--;
    st[++top] = p[i];
  }
  sz = top - 1;
  for (int i = 1; i <= sz; i++) p[i] = st[i + 1];
}
double query(long long k) {
  int l = 1, r = sz;
  while (r - l > 2) {
    int m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
    if (calc(p[m1], k) <= calc(p[m2], k))
      r = m2;
    else
      l = m1;
  }
  double ans = 1e18;
  for (int i = l; i <= r; i++) ans = min(ans, calc(p[i], k));
  return ans;
}
namespace Flow {
int dis[55], cur[55];
bool in[55];
queue<int> q;
bool spfa() {
  memset(in, 0, sizeof(in));
  memset(dis, 0x3f, sizeof(dis));
  dis[vs] = 0;
  in[vs] = 1;
  q.push(vs);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    in[x] = 0;
    cur[x] = head[x];
    for (int i = head[x]; i != -1; i = e[i].next)
      if (e[i].f && dis[x] + e[i].v < dis[e[i].t]) {
        int u = e[i].t;
        dis[u] = dis[x] + e[i].v;
        if (!in[u]) {
          in[u] = 1;
          q.push(u);
        }
      }
  }
  return dis[vt] < 0x3f3f3f3f;
}
int vis[55], cnt;
int dfs(int x, int a) {
  if (x == vt || !a) return a;
  vis[x] = cnt;
  int ans = 0;
  for (int &i = cur[x]; i != -1; i = e[i].next)
    if (e[i].f && vis[e[i].t] < cnt && dis[x] + e[i].v == dis[e[i].t]) {
      int u = e[i].t;
      int f = dfs(u, min(a, e[i].f));
      if (f) {
        e[i].f -= f;
        e[i ^ 1].f += f;
        ans += f;
        a -= f;
        if (!a) break;
      }
    }
  return ans;
}
void msmf() {
  long long s1 = 0, s2 = 0;
  while (spfa()) {
    int t;
    do {
      cnt++;
      t = dfs(vs, 0x3f3f3f3f);
      s1 += t;
      s2 += (long long)t * dis[vt];
    } while (t);
    p[++sz] = Point(s1, s2);
  }
}
}  // namespace Flow
int main() {
  memset(head, 255, sizeof(head));
  int n, m;
  scanf("%d%d", &n, &m);
  vs = 1;
  vt = n;
  for (int i = 1; i <= m; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    addEdge(x, y, 1, z);
  }
  Flow::msmf();
  gethull();
  int k;
  scanf("%d", &k);
  for (int i = 1; i <= k; i++) {
    int x;
    scanf("%d", &x);
    printf("%.10f\n", query(x));
  }
  return 0;
}