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 node {
  long long s, t, v, c, op, next;
} a[10010];
queue<long long> q;
pair<long long, long long> h[10010];
double ans[100010];
long long head[210], dis[210], n, m, p, vs, vt, tot, flow, cost;
bool inq[210], vis[210];
inline long long rd() {
  long long x = 0;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return x;
}
inline void add(long long x, long long y, long long z, long long c) {
  a[++tot].s = x;
  a[tot].t = y;
  a[tot].v = z;
  a[tot].c = c;
  a[tot].op = tot + 1;
  a[tot].next = head[x];
  head[x] = tot;
  a[++tot].s = y;
  a[tot].t = x;
  a[tot].v = 0;
  a[tot].c = -c;
  a[tot].op = tot - 1;
  a[tot].next = head[y];
  head[y] = tot;
}
inline bool spfa() {
  while (!q.empty()) q.pop();
  for (int i = 1; i <= n; i++) dis[i] = 2333333333333333333LL;
  memset(inq, false, sizeof(inq));
  q.push(vt);
  dis[vt] = 0;
  inq[vt] = true;
  while (!q.empty()) {
    long long x = q.front();
    q.pop();
    for (long long i = head[x]; i; i = a[i].next)
      if (a[a[i].op].v) {
        long long t = a[i].t;
        if (dis[t] > dis[x] - a[i].c) {
          dis[t] = dis[x] - a[i].c;
          if (!inq[t]) q.push(t), inq[t] = true;
        }
      }
    inq[x] = false;
  }
  return (dis[vs] != 2333333333333333333LL);
}
inline long long dfs(long long x, long long y) {
  if (x == vt || !y) return y;
  long long res = 0;
  vis[x] = true;
  for (long long i = head[x]; i; i = a[i].next) {
    long long t = a[i].t;
    if (vis[t] || !a[i].v || dis[t] != dis[x] - a[i].c) continue;
    long long hh = dfs(t, min(y, a[i].v));
    if (!hh) continue;
    res += hh;
    y -= hh;
    cost += hh * a[i].c;
    a[i].v -= hh;
    a[a[i].op].v += hh;
    if (!y) break;
  }
  return res;
}
int main() {
  n = rd();
  m = rd();
  vs = 1;
  vt = n;
  tot = 0;
  for (long long i = 1; i <= m; i++) {
    long long x = rd(), y = rd(), c = rd(), v = 1;
    add(x, y, v, c);
  }
  long long tt = 0;
  while (spfa()) {
    do {
      memset(vis, false, sizeof(vis));
      flow += dfs(vs, 2333333333333333333LL);
      h[++tt] = pair<long long, long long>(flow, cost);
    } while (vis[vt]);
  }
  long long now = 1;
  for (long long i = 0; i <= 100000; i++) {
    while (now < tt && (h[now + 1].second + i) * h[now].first <=
                           (h[now].second + i) * h[now + 1].first)
      now++;
    ans[i] = (double)(h[now].second + i) / h[now].first;
  }
  long long Q = rd();
  while (Q--) printf("%.10lf\n", ans[rd()]);
  return 0;
}