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;
inline long long read() {
  long long x = 0, neg = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  return x * neg;
}
inline void print(long long x) {
  if (x < 0) {
    putchar('-');
    print(abs(x));
    return;
  }
  if (x <= 9)
    putchar(x + '0');
  else {
    print(x / 10);
    putchar(x % 10 + '0');
  }
}
inline long long qpow(long long x, long long e, long long _MOD) {
  long long ans = 1;
  while (e) {
    if (e & 1) ans = ans * x % _MOD;
    x = x * x % _MOD;
    e >>= 1;
  }
  return ans;
}
long long head[100005], ecnt = 1;
struct edge {
  long long to, nxt, cap, cost;
} e[1000005];
inline void addedge(long long u, long long v, long long f, long long c) {
  e[++ecnt].to = v;
  e[ecnt].cap = f;
  e[ecnt].cost = c;
  e[ecnt].nxt = head[u];
  head[u] = ecnt;
}
bool vis[100005];
long long dist[100005], flow[100005], pre[100005], pos[100005];
inline bool spfa(long long s, long long t) {
  memset(vis, 1, sizeof(vis));
  memset(dist, 63, sizeof(dist));
  queue<long long> q;
  vis[s] = 0;
  dist[s] = 0;
  flow[s] = 0x3f3f3f3f;
  q.push(s);
  while (!q.empty()) {
    long long x = q.front();
    vis[x] = true;
    for (long long i = head[x]; i; i = e[i].nxt) {
      long long y = e[i].to;
      if (e[i].cap > 0 && dist[y] > dist[x] + e[i].cost) {
        dist[y] = dist[x] + e[i].cost;
        pos[y] = x;
        pre[y] = i;
        flow[y] = min(flow[x], e[i].cap);
        if (vis[y]) {
          q.push(y);
          vis[y] = false;
        }
      }
    }
    q.pop();
  }
  return dist[t] < 0x3f3f3f3f3f3f3f3fll;
}
vector<pair<long long, long long> > pth;
inline long long Dinic(long long s, long long t) {
  long long sum = 0;
  while (spfa(s, t)) {
    sum += flow[t] * dist[t];
    pth.push_back({flow[t], dist[t]});
    for (long long i = t; i != s; i = pos[i]) {
      e[pre[i]].cap -= flow[t];
      e[pre[i] ^ 1].cap += flow[t];
    }
  }
  return sum;
}
signed main() {
  long long n = read(), m = read();
  for (long long i = 1; i <= m; i++) {
    long long u = read(), v = read(), w = read();
    addedge(u, v, 1, w);
    addedge(v, u, 0, -w);
  }
  Dinic(1, n);
  long long T = read();
  while (T--) {
    long long x = read();
    double ans = 1e18;
    long long ccnt = 0, fcnt = 0;
    for (__typeof(pth.begin()) it = pth.begin(); it != pth.end(); it++) {
      if (ans < (it->second)) break;
      ccnt += (it->first) * (it->second);
      fcnt += it->first;
      ans = 1.0 * (x + ccnt) / fcnt;
    }
    printf("%.15lf\n", ans);
  }
  return 0;
}