So I tried problem G on the last div3 contest, my solution seems to work with small test case but then gave me an TLE with bigger test case
My submission : https://mirror.codeforces.com/contest/1941/submission/251046117
Problem's statement : https://mirror.codeforces.com/contest/1941/problem/G
UPD : sorry my dijkstra implementation was wrong :v