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 gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
typedef struct MCMF {
  int n, m;
  vector<int> ghead, gnxt, gto, gcap;
  vector<long long> gcost;
  vector<long long> d;
  vector<int> bck;
  vector<long long> pot;
  vector<int> flow;
  void init(int _n) {
    n = _n, m = 0;
    ghead = vector<int>(n, -1);
    gnxt.clear(), gto.clear(), gcap.clear(), gcost.clear();
    d = vector<long long>(n);
    bck = vector<int>(n);
    pot = vector<long long>(n, 0);
    flow = vector<int>(n);
  }
  void addedge(int a, int b, int c, long long d) {
    gnxt.push_back(ghead[a]);
    ghead[a] = m;
    gto.push_back(b);
    gcap.push_back(c);
    gcost.push_back(+d);
    ++m;
    gnxt.push_back(ghead[b]);
    ghead[b] = m;
    gto.push_back(a);
    gcap.push_back(0);
    gcost.push_back(-d);
    ++m;
  }
  vector<long long> opt;
  pair<int, long long> solve(int s, int t) {
    for (int i = (0); i < (n); ++i) d[i] = LLONG_MAX, bck[i] = -1;
    d[s] = 0, bck[s] = -2;
    while (true) {
      bool change = false;
      for (int at = (0); at < (n); ++at)
        if (d[at] != LLONG_MAX)
          for (int x = ghead[at]; x != -1; x = gnxt[x])
            if (gcap[x] > 0) {
              int to = gto[x];
              if (d[at] + gcost[x] >= d[to]) continue;
              d[to] = d[at] + gcost[x];
              bck[to] = x ^ 1;
              change = true;
            }
      if (!change) break;
    }
    if (d[t] == LLONG_MAX) return make_pair(0, 0);
    for (int i = (0); i < (n); ++i) pot[i] = d[i];
    opt.clear();
    opt.push_back(0);
    pair<int, long long> ret = make_pair(0, 0LL);
    while (true) {
      for (int i = (0); i < (n); ++i)
        d[i] = LLONG_MAX, bck[i] = -1, flow[i] = 0;
      d[s] = 0, bck[s] = -2, flow[s] = INT_MAX;
      priority_queue<pair<long long, int> > q;
      q.push(make_pair(-d[s], s));
      while (!q.empty()) {
        long long cost = -q.top().first;
        int at = q.top().second;
        q.pop();
        if (cost > d[at]) continue;
        for (int x = ghead[at]; x != -1; x = gnxt[x])
          if (gcap[x] > 0) {
            int to = gto[x];
            long long rcost = gcost[x] + pot[at] - pot[to];
            if (d[at] + rcost >= d[to]) continue;
            d[to] = d[at] + rcost;
            bck[to] = x ^ 1;
            flow[to] = min(flow[at], gcap[x]);
            q.push(make_pair(-d[to], to));
          }
      }
      if (d[t] == LLONG_MAX) break;
      assert(flow[t] > 0);
      for (int i = (0); i < (n); ++i)
        if (d[i] != LLONG_MAX) pot[i] += d[i];
      ret.first += flow[t], ret.second += pot[t] * flow[t];
      assert(flow[t] == 1);
      opt.push_back(ret.second);
      for (int at = t; at != s; at = gto[bck[at]]) {
        gcap[bck[at]] += flow[t];
        gcap[bck[at] ^ 1] -= flow[t];
      }
    }
    return ret;
  }
} MCMF;
const int MAXN = 50;
const int MAXM = MAXN * (MAXN - 1);
const int MAXQ = 100000;
int n, m;
int a[MAXM], b[MAXM], c[MAXM];
int nq;
int qlim[MAXQ];
double qans[MAXQ];
MCMF g;
void solve() {
  g.init(n);
  for (int i = (0); i < (m); ++i) g.addedge(a[i], b[i], 1, c[i]);
  g.solve(0, n - 1);
  for (int i = (0); i < (nq); ++i) {
    double cur = 1e200;
    for (int j = (1); j < (((int)(g.opt).size())); ++j) {
      int cnt = j, budget = qlim[i];
      long long cost = g.opt[j];
      cur = min(cur, 1.0 * (budget + cost) / cnt);
    }
    qans[i] = cur;
  }
}
void run() {
  scanf("%d%d", &n, &m);
  for (int i = (0); i < (m); ++i)
    scanf("%d%d%d", &a[i], &b[i], &c[i]), --a[i], --b[i];
  scanf("%d", &nq);
  for (int i = (0); i < (nq); ++i) scanf("%d", &qlim[i]);
  solve();
  for (int i = (0); i < (nq); ++i) printf("%.15lf\n", qans[i]);
}
int main() {
  run();
  return 0;
}