N个城市,标号从0到N-1,M条道路,第K条道路(K从0开始)的长度为2^K,求编号为0的城市到其他城市的最短距离。
第一行两个正整数N(2<=N<=100)M(M<=500),表示有N个城市,M条道路, 接下来M行两个整数,表示相连的两个城市的编号。
N-1行,表示0号城市到其他城市的最短路,如果无法到达,输出-1,数值太大的以MOD 100000 的结果输出。
4 3 0 1 1 2 2 0
1 3 -1