#914. 小码君送信-要改题面

小码君送信-要改题面

No submission language available for this problem.

Background

Special for beginners, ^_^

Description

题目描述

小码君要送东西,邮局在节点 1。他总共要送 n1 样东西,其目的地分别是节点 2 到节点 n。由于这个城市的交通比较繁忙,因此所有的道路都是单行的,共有 m 条道路。小码君每次只能带一样东西,并且​运送每件物品过后必须返回邮局​。求送完这 n1 样东西并且最终回到邮局最少需要的时间。

提示

对于 100% 的数据,1n10^31m10^51u,vn1w10^4,输入保证任意两点都能互相到达。

输入格式

第一行包括两个整数,nm,表示城市的节点数量和道路数量。

第二行到第 (m+1) 行,每行三个整数,u,v,w,表示从 uv 有一条通过时间为 w 的道路。

输出格式

输出仅一行,包含一个整数,为最少需要的时间。

Format

Input

Two integers x and y, satisfying 0x,y327670\leq x,y\leq 32767 .

Output

One integer, the sum of x and y.

Samples

5 10
2 3 5
1 5 5
3 5 6
1 2 8
1 3 8
5 3 4
4 1 8
4 5 3
3 5 6
5 4 2
83

Limitation

1s, 1024KiB for each test case.