#Lutece1636. 梦后楼台高锁,酒醒帘幕低垂
梦后楼台高锁,酒醒帘幕低垂
Migrated from Lutece 1636 梦后楼台高锁,酒醒帘幕低垂
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
给你一个有个点和条边的无向连通图,每条边都有一个权值.
我们定义,对于一条路径,它的Charm value为该路径上所有边的权值的最大值与最小值的差.
询问从到的所有路径的Charm value的最小值.
Input
第一行有两个整数$n,m\left ( 1\leq n\leq 200,n - 1\leq m\leq 1000 \right )$,表示该图有个点和条边.
接下来行,每行三个整数$u,v,w\left ( 1\leq u,v\leq n,1\leq w\leq 1000000 \right )$,表示点和点之间有一条权值为的边.
Output
输出一个数,即从到的所有路径的Charm value的最小值.
Samples
4 4
3 4 1
2 3 2
1 2 4
2 4 3
1
Resources
2017 UESTC Training for Graph Theory