Bobo has an undirected connected graph with n vertices and m edges, where the i-th edge is associated with two parameters aiand bi. Let f be the sum of weights of the edges in the minimum spanning tree when the weight of the i-th edge is ai+ bi· x, your task is to calculate the value of min.
Bobo has an undirected connected graph with n vertices and m edges, where the i-th edge is associated with two parameters ai and bi. Let f(x) be the sum of weights of the edges in the minimum spanning tree when the weight of the i-th edge is ai + bi · x, your task is to calculate the value of min( f(l), f(l+1), ... , f(r) ).
(图片来源网络,侵删)