Solve question (1) with the condition that the integer k should never move more than one position in a single move anytime during the execution of the search. If you need to move k more than one step, it will count multiple moves. Here k is given as an additional last input.
3 3 97 41 8 66 46 62 1 81 60 8 81 41 97 1 62 66 46 60 1 4 44 28 27 8 48 8 0 49 21 46 49 50 40 76 74 61 44 28 27 49 48 8 0 50 46 49 61 21 40 76 74 8 61 5 47 38 98 15 18 39 85 76 96 25 52 42 39 59 43 99 46 30 79 75 77 12 24 8 26 98 15 18 47 38 39 85 76 96 25 52 42 39 59 43 99 46 30 79 75 77 12 24 8 26 38
97 41 8 66 46 62 1 81 60 1 41 8 97 46 62 66 81 60 8 1 41 97 46 62 66 81 60 8 81 41 97 1 62 66 46 60 44 28 27 8 48 8 0 49 21 46 49 50 40 76 74 61 44 28 27 49 48 8 0 50 21 46 49 61 40 76 74 8 44 28 27 49 48 8 0 50 46 49 61 21 40 76 74 8 47 38 98 15 18 39 85 76 96 25 52 42 39 59 43 99 46 30 79 75 77 12 24 8 26 38 98 15 18 47 39 85 76 96 25 52 42 39 59 43 99 46 30 79 75 77 12 24 8 26 98 15 18 47 38 39 85 76 96 25 52 42 39 59 43 99 46 30 79 75 77 12 24 8 26