#include #include #include #include #include using namespace std; const int maxn = 3005; const int maxm = 100005; int cost[maxn]; int n,m; int main() { int u,v,w; while(scanf("%d%d",&n,&m)!=EOF) { memset(cost,0,sizeof(cost)); for(int i=0;i