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 inf_int = 1e9 + 100;
const long long inf_ll = 1e18;
const double pi = 3.1415926535898;
template <class T1, class T2>
std::ostream &operator<<(std::ostream &out, const std::pair<T1, T2> &rhs) {
  out << "( " << rhs.first << " , " << rhs.second << " )";
  return out;
}
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string &s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
bool debug = 0;
const int MAXN = 5000 + 100;
const int LOG = 21;
const int mod = 1e9 + 7;
const int MX = (2e7 + 100);
struct Edge {
  int a, b, c, flow, cost;
};
vector<pair<long long, long long> > spec;
struct MIN_FLOW {
  vector<Edge> e;
  vector<int> g[MAXN];
  int n, s, t;
  int id[MAXN];
  long long dis[MAXN];
  int from[MAXN];
  void init(int N, int S, int T) {
    n = N;
    s = S;
    t = T;
  }
  void add_edge(int a, int b, int c, int cost) {
    Edge e1 = {a, b, c, 0, cost};
    Edge e2 = {b, a, 0, 0, -cost};
    g[a].push_back(e.size());
    e.push_back(e1);
    g[b].push_back(e.size());
    ;
    e.push_back(e2);
  }
  long long get_val(int k) {
    int flow = 0;
    long long cost = 0;
    while (1) {
      queue<int> q;
      fill(id, id + n, 0);
      fill(dis, dis + n, inf_ll);
      dis[s] = 0;
      id[s] = 1;
      q.push(s);
      while (!q.empty()) {
        int v = q.front();
        q.pop();
        id[v] = 0;
        for (int ind : g[v]) {
          Edge &edge = e[ind];
          int to = edge.b;
          if (edge.c > edge.flow && dis[edge.b] > dis[v] + edge.cost) {
            if (id[to] == 0) {
              q.push(to);
              id[to] = 1;
            }
            dis[to] = dis[v] + edge.cost;
            from[to] = ind;
          }
        }
      }
      spec.push_back({dis[t], flow + 1});
      if (dis[t] == inf_ll) break;
      int addflow = 1;
      int v = t;
      while (v != s) {
        int ind = from[v];
        cost += 1ll * e[ind].cost * addflow;
        e[ind].flow += addflow;
        e[ind ^ 1].flow -= addflow;
        v = e[ind].a;
      }
      flow += addflow;
      if (flow == k) break;
    }
    return cost;
  }
} flow;
void solve() {
  int n, m;
  cin >> n >> m;
  int s = 1, t = n;
  for (int i = 1; i <= m; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    flow.add_edge(a, b, 1, c);
  }
  flow.init(n + 5, s, t);
  flow.get_val(inf_int);
  int q;
  cin >> q;
  while (q--) {
    int x;
    cin >> x;
    long double ans = spec[0].first;
    long double total_cost = 0;
    for (int i = 0; i + 1 < (int(spec.size())); ++i) {
      total_cost += spec[i].first;
      long double need = spec[i].first * spec[i].second;
      if (total_cost + x >= need) {
        ans = min<long double>(
            spec[i].first + (total_cost + x - need) / spec[i].second,
            spec[i + 1].first);
      } else {
        break;
      }
    }
    cout << ans << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.precision(15);
  int t = 1;
  while (t--) solve();
  42;
}