The actual queries and the operations in their optimal ways are shown as followings:
-
x=1,y=9x = 1,\; y = 9x=1,y=9, optimal 666 operations: 1‾→2‾→4‾→8‾→16‾→1‾0→9\underline{1} \to \underline{2} \to \underline {4} \to \underline{8} \to 1\underline{6} \to \underline{1}0 \to 91→2→4→8→16→10→9.
-
x=22,y=23x = 22,\; y = 23x=22,y=23, optimal 666 operations: 2‾2→24‾→2‾8→3‾0→2‾7→2‾5→23\underline{2}2 \to 2\underline{4} \to \underline{2}8 \to \underline{3}0 \to \underline{2}7 \to \underline{2}5 \to 2322→24→28→30→27→25→23.
-
x=23,y=22x = 23,\; y = 22x=23,y=22, optimal 222 operations: 23‾→2‾0→222\underline{3} \to \underline{2}0 \to 2223→20→22.
-
x=2,y=6x = 2,\; y = 6x=2,y=6, impossible.
-
x=12,y=0x = 12,\; y = 0x=12,y=0, optimal 333 operations: 12‾→1‾0→9‾→01\underline{2} \to \underline{1}0 \to \underline{9} \to 012→10→9→0.
-
x=0,y=3x = 0,\; y = 3x=0,y=3, impossible.