Medium Beginners Problems > Ad-hoc

Topu is a student of Computer Science & Engineering. And recently he taken a course of 3 credits named Algorithm Design & Analysis. He is so much interested for writing new algorithms with new techniques. Recently he invented some new techniques for writing pseudo-code. His techniques is designed for four types of operation. First one is: '**+**' Second one is: '**-**' Third one is: '*****' Fourth one is: '**/**' The pseudo-code for these operation is given below with examples: 4+3 -> "**add 4 to 3**" 4-3 -> "**subtract 3 from 4**" 4*3 -> "**multiply 4 with 3**" 4/3 -> "**divide 4 by 3**" **Note:** If any steps repeat then the output will be "**repeat step x**". where x is the step number when **the instruction was written** Don't count the repeated instructions as a new step. Be careful about some instructions like **4+3 & 3+4 is a same type of instruction** because they both creates same result 7. Although 5+2 is not considered same which also creates the same result 7. Also, **4*3 and 3*4 are considered same instruction**. Input: ------ There will be multiple cases upto EOF. Input starts with an integer **N (1<=N<=20)**, denoting the number of instructions set. Each case contains two integers **x** & **y** with any of the four operation which mentioned above. **(0<=x,y<=9)** Output: ------- For each case of input there should be one line of output with a case number like ("**Instruction x:** " where x denotes the instruction number) and the pseudo-code of the operation followed by a new line. For more clarification please see the simple input and output. Sample Input ------------ 5 4+3 4*3 4/3 4-3 4/3 1 4+3 Sample Output ------------- Instruction 1: add 4 to 3 Instruction 2: multiply 4 with 3 Instruction 3: divide 4 by 3 Instruction 4: subtract 3 from 4 Instruction 5: repeat step 3 Instruction 1: add 4 to 3

Mir Lutfur Rahman