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;
struct edge {
  long long a, b;
  long long cost;
  long long cap;
  edge(long long a, long long b, long long cap, long long cost)
      : a(a), b(b), cap(cap), cost(cost){};
  long long other(long long v) { return v == a ? b : a; }
  long long capTo(long long v) { return v == b ? cap : 1 - cap; }
  void addflow(long long v, long long fl) {
    if (v == b) {
      cap -= fl;
    } else {
      cap += fl;
    }
  }
  long long costTo(long long to) { return to == b ? cost : -cost; }
};
vector<edge> edges;
vector<vector<long long> > g;
vector<long long> dist, p;
long long allcost = 0;
long long allflow = 0;
signed main() {
  long long n, m;
  cin >> n >> m;
  dist.resize(n);
  p.resize(n);
  g.resize(n);
  long long st = 0, end = n - 1;
  for (long long i = 0; i < m; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    a--;
    b--;
    edges.push_back(edge(a, b, 1, c));
    g[a].push_back(edges.size() - 1);
    g[b].push_back(edges.size() - 1);
  }
  vector<pair<long long, long long> > mass;
  mass.push_back({0, 0});
  while (true) {
    for (long long i = 0; i < n; i++) {
      dist[i] = 1e9;
    }
    dist[0] = 0;
    p[0] = -1;
    queue<long long> q;
    q.push(0);
    while (!q.empty()) {
      long long v = q.front();
      q.pop();
      for (long long i = 0; i < g[v].size(); i++) {
        long long e = g[v][i];
        long long to = edges[g[v][i]].other(v);
        if (edges[e].capTo(to)) {
          if (dist[to] > dist[v] + edges[e].costTo(to)) {
            dist[to] = dist[v] + edges[e].costTo(to);
            p[to] = e;
            q.push(to);
          }
        }
      }
    }
    mass.push_back({allflow * dist[n - 1] - allcost, dist[n - 1]});
    if (dist[n - 1] == 1e9) {
      break;
    }
    long long flow = 1e9;
    for (long long i = n - 1; i != 0; i = edges[p[i]].other(i)) {
      flow = min(flow, edges[p[i]].capTo(i));
    }
    for (long long i = n - 1; i != 0; i = edges[p[i]].other(i)) {
      edges[p[i]].addflow(i, flow);
    }
    allflow += flow;
    allcost += flow * dist[n - 1];
  }
  long long q;
  cin >> q;
  while (q--) {
    long long x;
    cin >> x;
    long long ind =
        lower_bound(mass.begin(), mass.end(), make_pair(x + 1, st)) -
        mass.begin();
    double D = (long double)((x - mass[ind - 1].first) * mass[ind].second +
                             (mass[ind].first - x) * (mass[ind - 1].second)) /
               (mass[ind].first - mass[ind - 1].first);
    cout << fixed << setprecision(10) << D << "\n";
  }
  return 0;
}