Module: (Python) Tasks for using a while loop


Problem

6 /9


splitter

Problem

Performer “The Splitter” convert natural numbers. It has two commands: “Subtract 1” and “Divide by 2”, the first command reduces the number by 1, the second command reduces the number by half if it is even, otherwise an error occurs.

Given two natural numbers A and B (\(A>B\)). Write an algorithm for the Splitter that converts the number A to the number B and at the same time contains the minimum number of instructions. Algorithm commands should be output one per line, the first command is denoted as -1, the second command as :2.

Input
Two natural numbers A and B are entered (one number per line).

Imprint
Print the answer to the problem.
 

 

Examples
# Input Output
1 100
1
:2
:2
-1
:2
:2
:2
-1
:2