There are n cities (0…n−1) and directed flights u v w (from u to v costing w). Find the cheapest price from src to dst using at most k stops (i.e. at most k intermediate cities), or -1 if impossible.
Input
n mu v wsrc dst kOutput: the cheapest price, or -1.
4 5 0 1 100 1 2 100 2 0 100 1 3 600 2 3 200 0 3 1
700
0→1→3; the cheaper 0→1→2→3 needs 2 stops.
3 3 0 1 100 1 2 100 0 2 500 0 2 1
200
3 3 0 1 100 1 2 100 0 2 500 0 2 0
500
Run your code against the sample tests, or Submit to run the full suite.