import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.*; public class Main { static int n,m; static int N=300010; static int[] in=new int[N+1]; static long[] dis=new long[N+1]; static Queue<Integer> q=new LinkedList<>(); static class Node{ int v; long w; Node(int v,long w){ this.v=v; this.w=w; } } static ArrayList<Node>[] e=new ArrayList[N+1]; static long INF=0x3f3f3f3f3f3f3f3fL; public static void spfa(){ int s=1; Arrays.fill(dis,INF); dis[s]=0; in[s]=1; q.add(s); while(!q.isEmpty()){ Integer now=q.poll(); in[now]=0; if(dis[now]==INF)continue; for(Node x:e[now]){ if(dis[x.v]>dis[now]+x.w){ dis[x.v]=dis[now]+
01-02
820

04-17