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;
long long cnt = 1, n, m, qq, aaa, bbb, maf, co, tp;
long long head[100010], w[100010], dep[100010], fl[10010], cm[100010],
    mp[100010];
struct abc {
  long long to, nxt, w, c;
} e[1000010];
void add(long long u, long long v, long long w, long long c) {
  e[++cnt].nxt = head[u];
  e[cnt].to = v;
  e[cnt].w = w;
  e[cnt].c = c;
  head[u] = cnt;
  e[++cnt].nxt = head[v];
  e[cnt].to = u;
  e[cnt].w = 0;
  e[cnt].c = -c;
  head[v] = cnt;
}
bool bfs() {
  for (long long i = 0; i <= n; i++) dep[i] = 2e15, fl[i] = 2e15, mp[i] = 0;
  queue<long long> q;
  q.push(aaa);
  mp[aaa] = 1;
  dep[aaa] = 0;
  while (!q.empty()) {
    long long x = q.front();
    q.pop();
    mp[x] = 0;
    for (long long i = head[x]; i; i = e[i].nxt) {
      long long v = e[i].to;
      if (e[i].w == 0) continue;
      if (dep[x] + e[i].c < dep[v]) {
        dep[v] = dep[x] + e[i].c;
        fl[v] = min(fl[x], e[i].w);
        cm[v] = i;
        if (!mp[v]) q.push(v), mp[v] = 1;
      }
    }
  }
  if (dep[bbb] != 2e15) return true;
  return false;
}
void ek() {
  while (bfs()) {
    long long x = bbb;
    while (x != aaa) {
      long long i = cm[x];
      e[i].w -= fl[bbb];
      e[i ^ 1].w += fl[bbb];
      x = e[i ^ 1].to;
    }
    maf += fl[bbb];
    co += dep[bbb] * fl[bbb];
    w[++tp] = dep[bbb] * fl[bbb];
  }
}
signed main() {
  cin >> n >> m;
  for (long long i = 1, u, v, w, c; i <= m; i++) {
    cin >> u >> v >> c;
    add(u, v, 1, c);
  }
  aaa = 1, bbb = n;
  ek();
  sort(w + 1, w + tp + 1);
  cin >> qq;
  for (long long i = 1, x; i <= qq; i++) {
    cin >> x;
    if (!x) {
      cout << setprecision(10) << fixed << 1.00 * w[1] << endl;
      continue;
    }
    for (long long j = 1; j < tp; j++) {
      if (x >= j * (w[j + 1] - w[j])) {
        x -= j * (w[j + 1] - w[j]);
        if (x == 0) {
          cout << setprecision(10) << fixed << 1.00 * w[j + 1] << endl;
          break;
        }
        continue;
      }
      cout << setprecision(10) << fixed << w[j] + 1.00 * x / j << endl;
      x = 0;
      break;
    }
    if (x) cout << setprecision(10) << fixed << (1.00 * x / tp) + w[tp] << endl;
  }
}