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;
int Q, n, m, i, j, k, l, x, L, R, mid, mid2;
int a[50001][4], ls[51], len;
int Cost[51];
double ans, S;
void NEW(int x, int y, int z, int w) {
  ++len;
  a[len][0] = y;
  a[len][1] = ls[x];
  ls[x] = len;
  a[len][2] = z;
  a[len][3] = w;
}
void New(int x, int y, int z, int w) { NEW(x, y, z, w), NEW(y, x, 0, -w); }
int d[50001], f[51], g[51], I, h, t;
void work() {
  while (1) {
    h = 0, t = 1, d[1] = 1;
    memset(f, 180, sizeof(f)), f[1] = g[1] = 0;
    while (h < t) {
      for (i = ls[d[++h]]; i; i = a[i][1])
        if (a[i][2] && f[a[i][0]] < f[d[h]] + a[i][3]) {
          f[a[i][0]] = f[d[h]] + a[i][3];
          g[a[i][0]] = i;
          d[++t] = a[i][0];
        }
    }
    if (f[n] >= -1000000000) {
      ++I, Cost[I] = f[n] + Cost[I - 1];
      for (i = n; i != 1; i = a[g[i] ^ 1][0]) --a[g[i]][2], ++a[g[i] ^ 1][2];
    } else
      break;
  }
}
double js(int x, int t) { return ((double)x - Cost[t]) / t; }
int main() {
  scanf("%d%d", &n, &m), len = 1;
  for (i = 1; i <= m; i++) scanf("%d%d%d", &j, &k, &l), New(j, k, 1, -l);
  work();
  scanf("%d", &Q);
  for (; Q; --Q) {
    scanf("%d", &x), ans = 2147483647;
    L = 1, R = I;
    while (R - L > 3) {
      mid = (L + R) / 2, mid2 = (mid + R) / 2;
      if (js(x, mid) > js(x, mid2))
        L = mid;
      else
        R = mid2;
    }
    for (i = L; i <= R; i++) S = js(x, i), ans = (ans < S ? ans : S);
    printf("%.10lf\n", ans);
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}