#include #include template inline void read(T& t) { t=0; int ch,f=false; while(ch=getchar(),!((ch>='0'&&ch<='9')||ch=='-')); if(ch=='-') f=true,ch=getchar(); t=ch^48; while(ch=getchar(),ch>='0'&&ch<='9') t=t*10+(ch^48); if(f) t=-t; } template inline void read(T& t,Args&... args) { read(t); read(args...); } inline int min(const int &a,const int &b) { return a0) { read(a,b,c); G[a][b]=G[b][a]=c; } memcpy(dis,G,sizeof(dis)); for(int k=1;k<=n;++k) { for(int i=1;i