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;
namespace MCMF {
const int MV = 300;
const int ME = 30000;
int st[MV], en[ME << 1], nxt[ME << 1], flow[ME << 1], cost[ME << 1], ce;
const int INF = 1e9;
void init() {
  memset(st, 0, sizeof st);
  ce = 1;
}
void addE(int s, int e, int c, int f = 1) {
  ++ce;
  nxt[ce] = st[s];
  st[s] = ce;
  en[ce] = e;
  flow[ce] = f;
  cost[ce] = c;
  ++ce;
  nxt[ce] = st[e];
  st[e] = ce;
  en[ce] = s;
  flow[ce] = 0;
  cost[ce] = -c;
}
int inq[MV], pre[MV];
int dis[MV];
int spfa(int N, int ST, int EN) {
  for (int i = 1; i <= N; i++) inq[i] = 0, pre[i] = -1, dis[i] = INF;
  queue<int> que;
  inq[ST] = 1;
  que.push(ST);
  dis[ST] = 0;
  while (!que.empty()) {
    int t = que.front();
    que.pop();
    inq[t] = 0;
    for (int i = st[t]; i; i = nxt[i])
      if (flow[i] > 0) {
        if (dis[en[i]] > dis[t] + cost[i]) {
          dis[en[i]] = dis[t] + cost[i];
          pre[en[i]] = i;
          if (inq[en[i]] == 0) {
            que.push(en[i]);
            inq[en[i]] = 1;
          }
        }
      }
  }
  if (dis[EN] == INF) return INF;
  int t = EN;
  while (t != ST) {
    int p = pre[t];
    flow[p]--;
    flow[p ^ 1]++;
    t = en[p ^ 1];
  }
  return dis[EN];
}
int Get(int N, int ST, int EN) {
  int ans = 0;
  while (1) {
    int t = spfa(N, ST, EN);
    if (t == INF) break;
    ans += t;
  }
  return ans;
}
}  // namespace MCMF
double ans[100010];
void solve() {
  int n, m;
  scanf("%d%d", &n, &m);
  MCMF::init();
  for (int i = 0; i < (m); i++) {
    int x, y, c;
    scanf("%d%d%d", &x, &y, &c);
    MCMF::addE(x, y, c, 1);
  }
  map<int, int> Mx;
  while (1) {
    int co = MCMF::spfa(n, 1, n);
    Mx[co]++;
    if (co == MCMF::INF) break;
  }
  vector<pair<int, int> > Vx;
  for (pair<int, int> e : Mx) Vx.push_back(e);
  ans[0] = Vx[0].first;
  long long now = 0, ar = Vx[0].second;
  for (int i = 1; i < (int)(Vx).size(); i++) {
    long long nxt = (Vx[i].first - Vx[i - 1].first) * ar;
    for (long long x = now + 1; x <= now + nxt; x++) {
      if (x > 100000) break;
      ans[x] = ans[now] + (double)(x - now) / ar;
    }
    now += nxt;
    ar += Vx[i].second;
  }
  for (long long x = now + 1; x <= 100000; x++) {
    ans[x] = ans[now] + (double)(x - now) / ar;
  }
  int q;
  scanf("%d", &q);
  for (int qq = 0; qq < (q); qq++) {
    int x;
    scanf("%d", &x);
    printf("%.12f\n", ans[x]);
  }
}
int main() {
  int T = 1;
  for (int t = 1; t <= T; t++) {
    solve();
  }
  return 0;
}