Steiner Tree
题号:NC52775
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Bobo has a connected undirected simple graph with n vertices and m edges.
The vertices are numbered by conveniently, and the i-th edge has weight c_i.
For each integer , Bobo would like to choose a subset of edges to connect the vertices with each other.
The minimum sum of weight of valid subsets is denoted as f(k).
Find the value of .

输入描述:

The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains two integers n and m.
The i-th of the following m lines contains 3 integers a_i, b_i and c_i which denote the edge between vertices a_i and b_i with weight c_i.

输出描述:

For each test case, print (n - 1) integers which denote .
示例1

输入

复制
4 3
1 4 1
2 4 1
3 4 1
4 6
1 2 1
1 3 2
1 4 3
2 3 4
2 4 5
3 4 6

输出

复制
2
3
3
1
3
6

备注:

* 
*
*
*
* The number of test cases does not exceed 100.
* The number of test cases with n > 8 does not exceed 5.