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>
#pragma GCC optimize("O3")
using namespace std;
template <class C>
void mini(C &a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C &a4, C b4) {
  a4 = max(a4, b4);
}
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
class MinCostFlow {
  struct MCEdge {
    long long to, cost, flow;
    MCEdge *next;
  };
  const long long Infty = 1e9 + 100;
  long long N, Source, Sink;
  vector<long long> dist;
  vector<MCEdge *> prev, Edges;
  vector<vector<MCEdge *>> adjList;
  void spfa() {
    queue<long long> Q;
    vector<bool> onQueue(N);
    fill((dist).begin(), (dist).end(), Infty);
    Q.push(Source);
    onQueue[Source] = true;
    dist[Source] = 0;
    while (!Q.empty()) {
      long long v = Q.front();
      Q.pop();
      onQueue[v] = false;
      for (MCEdge *E : adjList[v]) {
        long long s = E->to;
        if (E->flow == 0) {
          continue;
        }
        long long newDist = dist[v] + E->cost;
        if (newDist < dist[s]) {
          dist[s] = newDist;
          prev[s] = E->next;
          if (!onQueue[s]) {
            Q.push(s);
            onQueue[s] = true;
          }
        }
      }
    }
  }
  long long reduce_cost() {
    for (long long v = (0); v <= ((long long)(N)-1); v++) {
      for (MCEdge *E : adjList[v]) {
        E->cost += dist[v] - dist[E->to];
      }
    }
    return dist[Sink];
  }
  void dijkstra_shortest_path() {
    fill((dist).begin(), (dist).end(), Infty);
    dist[Source] = 0;
    priority_queue<pair<long long, long long>> Q;
    Q.push(make_pair(0, Source));
    while (!Q.empty()) {
      long long dst = -Q.top().first, v = Q.top().second;
      Q.pop();
      if (dst != dist[v]) {
        continue;
      }
      for (MCEdge *E : adjList[v]) {
        long long s = E->to;
        if (!E->flow) {
          continue;
        }
        long long newDist = dist[v] + E->cost;
        if (newDist < dist[s]) {
          dist[s] = newDist;
          prev[s] = E->next;
          Q.push({-newDist, s});
        }
      }
    }
  }

 public:
  MinCostFlow() { N = 0; }
  MinCostFlow(long long _N) : N(_N), dist(_N), prev(_N), adjList(_N) {}
  ~MinCostFlow() {
    for (MCEdge *E : Edges) {
      delete E;
    }
  }
  void fit(long long size) {
    if (size > N) {
      N = size;
      dist.resize(size);
      prev.resize(size);
      adjList.resize(size);
    }
  }
  void add_edge(long long u, long long v, long long flow, long long cost) {
    fit(max(u, v) + 1);
    MCEdge *E1 = new MCEdge{v, cost, flow, 0}, *E2 = new MCEdge{u, -cost, 0, 0};
    Edges.push_back(E1);
    Edges.push_back(E2);
    E1->next = E2;
    E2->next = E1;
    adjList[u].push_back(E1);
    adjList[v].push_back(E2);
  }
  vector<long long> get_min_cost_flow(long long s, long long t) {
    fit(max(s, t) + 1);
    Source = s;
    Sink = t;
    spfa();
    if (dist[Sink] > Infty / 2) {
      return {0, 0};
    }
    long long sinkCost = reduce_cost();
    vector<long long> res;
    res.push_back(0);
    while (true) {
      dijkstra_shortest_path();
      if (dist[Sink] > Infty / 2) {
        break;
      }
      sinkCost += reduce_cost();
      long long maxSend = Infty;
      for (long long v = Sink; v != Source; v = prev[v]->to) {
        maxSend = min(maxSend, prev[v]->next->flow);
      }
      for (long long v = Sink; v != Source; v = prev[v]->to) {
        MCEdge *E1 = prev[v], *E2 = E1->next;
        E1->flow += maxSend;
        E2->flow -= maxSend;
      }
      for (long long i = (0); i <= ((long long)(maxSend)-1); i++) {
        res.push_back(res.back() + sinkCost);
      }
    }
    return res;
  }
};
long long n, m;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  if (0) cout << fixed << setprecision(6);
  cin >> n >> m;
  MinCostFlow flow;
  for (long long i = (0); i <= ((long long)(m)-1); i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    a--;
    b--;
    flow.add_edge(a, b, 1, c);
  }
  vector<long long> pom = flow.get_min_cost_flow(0, n - 1);
  long long q;
  cin >> q;
  for (long long i = (0); i <= ((long long)(q)-1); i++) {
    long long x;
    cin >> x;
    long double res = 1e18;
    for (long long j = (0); j <= ((long long)(((long long)(pom).size())) - 1);
         j++)
      if (j) {
        mini(res, ((long double)(pom[j] + x)) / j);
      }
    cout << res << "\n";
  }
}