Subin plays hide and seek with a younger sibling. Subin is at point N and the sibling is at point K. Subin either walks or teleports. When Subin is at position X and walks, one second later Subin is at X−1 or X+1. When Subin teleports, one second later Subin is at 2X.
Subin never moves to a position below 0 or above 100,000. The sibling stays in place.
Given both positions, write a program that finds the earliest time at which Subin reaches the sibling and the number of ways to reach the sibling in that time. Two ways are different when the sequence of actions differs. At position 1, for example, walking forward and teleporting both lead to position 2, and because the actions differ they count as two separate ways.