import sys input=sys.stdin.readline from heapq import heappop,heappush def dijkstra(s,n,edge): dist=[float("inf")]*n dist[s]=0 used=[-1]*n hq=[[dist[s],s]] while hq: d,cur=heappop(hq) if dist[cur]