import sequtils,strutils,strscans,algorithm,math,future,sets,queues,tables template get*():string = stdin.readLine() template times*(n:int,body:untyped): untyped = (for _ in 0..B にコスト C # ワーシャルフロイド => A->Bの距離がわかる # A,Bに滞在するとして 0->A->B->Nの最低コストが解 var a2b = newSeqWith(N,newSeqWith(N,INF)) for abc in ABC: var a,b,c = 0 (a,b,c) = abc a2b[a][b] = c a2b[b][a] = c for k in 0..