https://mirror.codeforces.com/contest/1846/submission/215981788
- how to type capital letters?
- if you've seen this approach before, post links in the comments.
dijkstra with segment tree
https://mirror.codeforces.com/contest/1846/submission/215981788