public static void main(String[] args) throws IOException { Reader in=new Reader(); int t1=in.nextInt(); for(int gj=0;gjcmp){ w[x][y]=cmp; w[y][x]=cmp; } } Stack t=new Stack(); int src=in.nextInt(); for(int i=1;i<=n;i++){ if(i!=src){t.push(i);}} Stack p=new Stack(); p.push(src); w[src][src]=0; while(!t.isEmpty()){int min=989997979,loc=-1; for(int i=0;i