Solve budget queries and shortest path | Microsoft