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;
const int MAXN = 55;
const int MAXM = 2505;
const int MAXQ = 100005;
int n, m, q, tot;
int flw[MAXM];
double ans[MAXQ];
pair<int, int> x[MAXQ];
namespace NetworkFlow {
struct Edge {
  int to;
  int w;
  int cap;
  int nxt;
} edge[MAXM << 1];
int S, T, id = 1;
int dis[MAXN];
int first[MAXN];
bool vis[MAXN];
bool inqueue[MAXN];
queue<int> Q;
void addE(int u, int v, int w, int c) {
  edge[++id] = (Edge){v, w, c, first[u]};
  first[u] = id;
  edge[++id] = (Edge){u, -w, 0, first[v]};
  first[v] = id;
}
bool bfs() {
  for (int i = 1; i <= n; i++) dis[i] = 1e9;
  dis[S] = 0;
  Q.push(S);
  inqueue[S] = 1;
  while (!Q.empty()) {
    int u = Q.front();
    inqueue[u] = 0;
    Q.pop();
    for (int i = first[u]; i; i = edge[i].nxt)
      if (edge[i].cap > 0 && dis[edge[i].to] > dis[u] + edge[i].w) {
        dis[edge[i].to] = dis[u] + edge[i].w;
        if (!inqueue[edge[i].to]) {
          inqueue[edge[i].to] = 1;
          Q.push(edge[i].to);
        }
      }
  }
  return dis[T] != 1e9;
}
int dfs(int u, int f) {
  if (u == T) return f;
  vis[u] = 1;
  int res = 0;
  for (int i = first[u]; i; i = edge[i].nxt)
    if (!vis[edge[i].to] && edge[i].cap > 0 &&
        dis[edge[i].to] == dis[u] + edge[i].w) {
      int ret = dfs(edge[i].to, min(edge[i].cap, f));
      edge[i].cap -= ret;
      edge[i ^ 1].cap += ret;
      f -= ret;
      res += ret;
      if (!f) break;
    }
  vis[u] = 0;
  if (!res) dis[u] = 1e9;
  return res;
}
void Dinic() {
  S = 1, T = n;
  while (bfs()) {
    int r = dfs(S, 1e9);
    while (r--) flw[++tot] = dis[T];
  }
}
}  // namespace NetworkFlow
int main() {
  scanf("%d%d", &n, &m);
  for (int u, v, w, i = 1; i <= m; i++) {
    scanf("%d%d%d", &u, &v, &w);
    NetworkFlow::addE(u, v, w, 1);
  }
  NetworkFlow::Dinic();
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    scanf("%d", &x[i].first);
    x[i].second = i;
  }
  sort(x + 1, x + q + 1);
  for (int i = 1; i <= tot; i++) flw[i] += flw[i - 1];
  for (int i = 1, j = 1; i <= q; i++) {
    while (j + 1 <= tot && (long long)(flw[j] + x[i].first) * (j + 1) >
                               (long long)(flw[j + 1] + x[i].first) * j)
      j++;
    ans[x[i].second] = (double)(flw[j] + x[i].first) / j;
  }
  for (int i = 1; i <= q; i++) printf("%.10lf\n", ans[i]);
  return 0;
}