Subin plays hide and seek with his younger sibling. Subin is at point N and the sibling is at point K. Subin can walk or teleport. If Subin is at X and walks, one second later he is at X−1 or X+1. If he teleports, one second later he is at 2X. Subin's position is never negative. The sibling never moves.
Given both positions, find the shortest time in which Subin reaches his sibling, together with the positions he passes through.
Several routes can take that shortest time. In that case pick the one whose sequence of visited positions is smallest in lexicographic order. All shortest routes have the same length, so compare two sequences from the front: the one with the smaller number at the first position where they differ comes first.