#include <iostream> #include <vector> #include <queue> using namespace std; const int N = 5100; struct Node { int id; int step; Node() {} Node(int _id, int _step) :id(_id), step(_step)...