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 main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int N, M;
  cin >> N >> M;
  vector<vector<int> > adj(2 * N);
  vector<vector<int> > cap(2 * N, vector<int>(2 * N, 0));
  vector<vector<int> > cost(2 * N, vector<int>(2 * N, 0));
  for (int i = 0; i < N; i++) {
    adj[2 * i].push_back(2 * i + 1);
    adj[2 * i + 1].push_back(2 * i);
    cap[2 * i][2 * i + 1] = N;
  }
  for (int i = 0; i < M; i++) {
    int from, to, w;
    cin >> from >> to >> w;
    if (from == N || to == 1 || from == to) continue;
    from = 2 * (from - 1) + 1, to = 2 * (to - 1);
    adj[from].push_back(to);
    adj[to].push_back(from);
    cost[from][to] = w;
    cost[to][from] = -w;
    cap[from][to] = 1;
  }
  N *= 2;
  vector<int> path_len_seq;
  for (int f = 0; f < N; f++) {
    vector<int> d(N, 1234567890);
    d[0] = 0;
    vector<int> m(N, 2);
    static deque<int> q;
    q.push_back(0);
    vector<int> p(N, -1);
    while (!q.empty()) {
      int u = q.front();
      q.pop_front();
      m[u] = 0;
      for (int v : adj[u]) {
        if (cap[u][v] > 0 && d[v] > d[u] + cost[u][v]) {
          d[v] = d[u] + cost[u][v];
          p[v] = u;
          if (m[v] == 2) {
            m[v] = 1;
            q.push_back(v);
          } else if (m[v] == 0) {
            m[v] = 1;
            q.push_front(v);
          }
        }
      }
    }
    if (d[N - 1] == 1234567890) break;
    path_len_seq.push_back(d[N - 1]);
    int cur = N - 1;
    while (cur) {
      cap[p[cur]][cur]--;
      cap[cur][p[cur]]++;
      cur = p[cur];
    }
  }
  int Q;
  cin >> Q;
  for (int q = 0, x; q < Q; q++) {
    cin >> x;
    double ans = 0, sum = 0;
    for (int i = 0; i < (int)path_len_seq.size(); i++) {
      sum += path_len_seq[i];
      double l = (x + sum) / (i + 1);
      if (i + 1 == (int)path_len_seq.size() || path_len_seq[i + 1] + 1e-4 > l)
        if (path_len_seq[i] < l + 1e-4) ans = max(ans, l);
    }
    cout << ans << "\n";
  }
}