#include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; class Edge { public: int cost; int from; int to; Edge(int n,int c) { to=n; cost=c; } Edge(int f,int t,int c) { from=f; to=t; cost=c; } }; int d[50][50]; //ワーシャルフロイド int s[50]; //start:0 int main() { int n,m; int ans=1e8-1; cin>>n; for(int i=0;i>s[i]; } s[0]=1e8; s[n-1]=1e8; cin>>m; fill(d[0],d[50],1e8-1); for(int i=0;i>a>>b>>c; d[a][b]=c; d[b][a]=c; } for(int i=0;i