using System; using System.IO; using System.Collections; using System.Collections.Generic; class Example { static int nv,ne; // вхідні дані з першого рядка static int [] l = new int [9]; // оцінка довжини static int [] p = new int [9]; // попередники static List> b = new List>();// списки суміжності static List> w = new List>();// ваги ребер static bool[] c = new bool[9]; // ознака сталості static int step (int j) { int i,k, s, // оцінка довжини, l_max=99999999; // верхня межа довжини шляху for (i=0; i s) { l[bji] = s; p[bji] = j; } } } s=l_max; for (k=0; kl[k]) { s=l[k]; i=k; } c[i]=true; return i; } public static void Main() { try { int u, // зчитана вага ребра i,j,k; // лічильники using (StreamReader file = new StreamReader("input.txt")) { string[] s = file.ReadLine().Split(' '); nv = Int32.Parse(s[0]); ne = Int32.Parse(s[1]); for (j=0; j()); w.Add(new List()); l[j]=999999; c[j]=false; p[j]=0; } for (i=0; i