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 fgraph {
const int MAXV = 50;
const int MAXE = 10 * MAXV * MAXV;
const int INF = (1 << 30);
struct edge {
  int to, cap, flow, cost;
  edge *nxt, *rev;
} edges[MAXE + 5], *adj[MAXV + 5], *cur[MAXV + 5], *ecnt = edges;
void addedge(int u, int v, int c, int w) {
  edge *p = (++ecnt), *q = (++ecnt);
  (*p) = (edge){v, c, 0, w, adj[u], q}, adj[u] = p;
  (*q) = (edge){u, 0, 0, -w, adj[v], p}, adj[v] = q;
}
int d[MAXV + 5], h[MAXV + 5], s, t;
bool relabel() {
  for (int i = s; i <= t; i++) h[i] += d[i], d[i] = INF, cur[i] = adj[i];
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      que;
  que.push(make_pair(d[t] = 0, t));
  while (!que.empty()) {
    int k = que.top().first, x = que.top().second;
    que.pop();
    if (k != d[x]) continue;
    for (edge *p = adj[x]; p; p = p->nxt) {
      if (p->rev->cap > p->rev->flow) {
        int dis = k + p->rev->cost + (h[x] - h[p->to]);
        if (dis < d[p->to]) que.push(make_pair(d[p->to] = dis, p->to));
      }
    }
  }
  return d[s] != INF;
}
bool vis[MAXV + 5];
int aug(int x, int tot) {
  if (x == t) return tot;
  vis[x] = true;
  int sum = 0;
  for (edge *&p = cur[x]; p; p = p->nxt) {
    int dis = d[p->to] + p->cost + (h[p->to] - h[x]);
    if (d[x] == dis && !vis[p->to] && p->cap > p->flow) {
      int del = aug(p->to, min(tot - sum, p->cap - p->flow));
      sum += del, p->flow += del, p->rev->flow -= del;
      if (sum == tot) break;
    }
  }
  vis[x] = false;
  return sum;
}
}  // namespace fgraph
int f[55];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    fgraph::addedge(u, v, 1, w);
  }
  int cnt = 0;
  fgraph::s = 1, fgraph::t = n;
  for (cnt = 0; fgraph::relabel(); cnt++)
    f[cnt + 1] = f[cnt] + fgraph::d[1] + fgraph::h[1], fgraph::aug(1, 1);
  int q;
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    int x;
    scanf("%d", &x);
    double ans = 1E12;
    for (int j = 1; j <= cnt; j++) ans = min(ans, 1.0 * (x + f[j]) / j);
    printf("%.9f\n", ans);
  }
}