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;
template <typename T>
bool vmin(T& a, T b) {
  return (a > b) ? (a = b, true) : (false);
}
template <typename T>
bool vmax(T& a, T b) {
  return (a < b) ? (a = b, true) : (false);
}
template <typename T>
T smax(T x) {
  return x;
}
template <typename T, typename... K>
T smax(T a, const K&... args) {
  return max(a, smax(args...));
}
template <typename T>
T smin(T x) {
  return x;
}
template <typename T, typename... K>
T smin(T a, const K&... args) {
  return min(a, smin(args...));
}
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& z) {
  os << "(" << z.first << ", " << z.second << ')';
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& a) {
  bool isfirst = true;
  os << "{";
  for (auto z : a) {
    if (!isfirst) {
      os << ", ";
    }
    os << z;
    isfirst = false;
  }
  os << '}';
  return os;
}
const int inf = (signed)(~0u >> 2);
const long long llf = (signed long long)(~0ull >> 2);
template <typename T>
void pfill(T* pst, const T* ped, T val) {
  for (; pst != ped; *(pst++) = val)
    ;
}
typedef class Data {
 public:
  int flow;
  int delta;
  long long cost;
  Data(int flow, int delta, long long cost)
      : flow(flow), delta(delta), cost(cost) {}
} Data;
typedef class Edge {
 public:
  int ed, nx, r, c;
  Edge() {}
  Edge(int ed, int nx, int r, int c) : ed(ed), nx(nx), r(r), c(c) {}
} Edge;
typedef class MapManager {
 public:
  int* h;
  vector<Edge> es;
  MapManager() {}
  MapManager(int n) {
    h = new int[(n + 1)];
    memset(h, -1, (n + 1) << 2);
  }
  void add_edge(int u, int v, int cap, int c) {
    es.emplace_back(v, h[u], cap, c);
    h[u] = (signed)es.size() - 1;
  }
  void add_arc(int u, int v, int cap, int c) {
    add_edge(u, v, cap, c);
    add_edge(v, u, 0, -c);
  }
  Edge& operator[](int p) { return es[p]; }
} MapManager;
typedef class Network {
 public:
  int S, T;
  MapManager g;
  Network() {}
  Network(int S, int T) : S(S), T(T), g(T) {
    f = new int[(T + 1)];
    le = new int[(T + 1)];
    mf = new int[(T + 1)];
    vis = new bool[T + 1];
    F.emplace_back(0, 0, 0);
  }
  int* dif;
  bool* vis;
  int *f, *le, *mf;
  void clear() {
    delete[] f;
    delete[] le;
    delete[] mf;
    delete[] vis;
    delete[] dif;
  }
  vector<Data> F;
  bool spfa() {
    queue<int> Q;
    pfill(f, f + T + 1, inf);
    pfill(vis, vis + T + 1, false);
    Q.push(S);
    f[S] = 0, mf[S] = inf, le[S] = -1;
    while (!Q.empty()) {
      int e = Q.front();
      Q.pop();
      vis[e] = false;
      for (int i = g.h[e], eu, w; ~i; i = g[i].nx) {
        eu = g[i].ed;
        if (!g[i].r) continue;
        w = f[e] + g[i].c;
        if (w < f[eu]) {
          f[eu] = w, mf[eu] = min(mf[e], g[i].r), le[eu] = i;
          if (!vis[eu]) {
            Q.push(eu);
            vis[eu] = true;
          }
        }
      }
    }
    if (f[T] == inf) return false;
    F.emplace_back(mf[T], f[T], 1ll * mf[T] * f[T]);
    int flow = mf[T], rt = 0;
    for (int p = T, e; p ^ S; p = g[le[p] ^ 1].ed) {
      e = le[p];
      rt += g[e].c;
      g[e].r -= flow;
      g[e ^ 1].r += flow;
    }
    return true;
  }
  void add_edge(int u, int v, int cap, int w) { g.add_arc(u, v, cap, w); }
} Network;
int n, m, q;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  Network g(1, n);
  for (int i = 1, u, v, w; i <= m; i++) {
    cin >> u >> v >> w;
    g.add_edge(u, v, 1, w);
  }
  while (g.spfa())
    ;
  auto& F = g.F;
  int sumf = 0;
  long long sumc = 0;
  for (auto& p : F) {
    sumf += p.flow;
    sumc += p.cost;
    p.flow = sumf;
    p.cost = sumc;
  }
  int X;
  cin >> q;
  while (q--) {
    cin >> X;
    int l = 1, r = (signed)F.size() - 1, mid;
    while (l <= r) {
      mid = (l + r) >> 1;
      int f = F[mid].flow;
      if (1ll * f * F[mid].delta <= X + F[mid].cost) {
        l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    --l;
    printf("%.9lf\n", 1.0 * (X + F[l].cost) / F[r].flow);
  }
  return 0;
}