you give network n node label 1 n you give time list travel time direct edge timesi ui vi wi ui source node vi target node wi time take signal travel source targetwe send signal give node k Return minimum time take n node receive signal if impossible n node receive signal return 1 Example 1input time 211231341 n 4 k 2output 2example 2Input times 121 n 2 k 1output 1Example 3Input times 121 n 2 k 2output 1 Constraints1 k n 1001 timeslength 6000timesilength 31 ui vi nui vi0 wi 100All pairs ui vi unique ie multiple edge