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>
struct Edge {
  int v1;
  int v2;
  int capacity;
  int cost;
};
std::vector<Edge> V;
std::vector<int> edge[50 + 1];
struct MCMF {
  void addEdge(int v1, int v2, int capacity, int cost) {
    V.push_back({v1, v2, capacity, cost});
    V.push_back({v2, v1, 0, -cost});
    int s1 = V.size() - 2, s2 = V.size() - 1;
    edge[v1].push_back(s1);
    edge[v2].push_back(s2);
  }
  int end;
  std::queue<int> Q;
  int check[50 + 1], dist[50 + 1];
  int prev[50 + 1];
  void SPFA(int start) {
    for (int i = 0; i <= 50; i++) dist[i] = 1234567890;
    dist[start] = 0;
    for (int i = 1; i <= 50; i++) {
      for (int j = 0; j < V.size(); j++) {
        int v1 = V[j].v1;
        int v2 = V[j].v2;
        int cap = V[j].capacity;
        int cost = V[j].cost;
        if (cap > 0 && dist[v1] + cost < dist[v2])
          dist[v2] = dist[v1] + cost, prev[v2] = j;
      }
    }
  }
  int func(int start) {
    int sum = 0;
    int p = end;
    while (p != start) {
      V[prev[p]].capacity--;
      V[prev[p] ^ 1].capacity++;
      sum += V[prev[p]].cost;
      p = V[prev[p]].v1;
    }
    return sum;
  }
  std::vector<int> flowTable(int start) {
    std::vector<int> ans;
    ans.push_back(0);
    int sum = 0;
    while (1) {
      SPFA(start);
      if (dist[end] == 1234567890) break;
      sum += func(start);
      ans.push_back(sum);
    }
    return ans;
  }
} F;
std::vector<int> table;
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  for (int i = 1; i <= b; i++) {
    int c, d, e;
    scanf("%d%d%d", &c, &d, &e);
    F.addEdge(c, d, 1, e);
  }
  F.end = a;
  table = F.flowTable(1);
  int c;
  scanf("%d", &c);
  for (int i = 1; i <= c; i++) {
    int d;
    scanf("%d", &d);
    double ans = 1234567890;
    for (int j = 1; j < table.size(); j++) {
      double s = (double)(table[j] + d) / j;
      ans = ans < s ? ans : s;
    }
    printf("%.12lf\n", ans);
  }
}