Problem2290--NOIP2009提高组第3题 最优贸易

2290: NOIP2009提高组第3题 最优贸易

Time Limit: 1.000 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 2
[Submit] [Status] [Web Board] [Creator:][下载测试数据]

Description


Input



Output

  共1行,包含1个整数,表示最多以赚取的旅费。如果没有进行贸易,则输出0、

Sample Input

5 5
4 3 5 6 1
1 2 1
1 4 1
2 3 2
3 5 1
4 5 2

Sample Output

5

Source/Category

 

[Submit] [Status]