Defuse The Bomb

3.6

17 votes
Problem

Platypus Perry is on a mission again. This time, Dr. Heinz Doofenshmirtz has plotted a bomb in the centre of Danville town. He wishes to rebuild the town. We need to defuse the bomb for Perry. As always, Dr. Heinz has given perry the key combination to defuse the bomb, but unfortunately Perry has not been able to get out of doctor's evil claws. Time is running out, and the key is to be built using two numbers Dr. Heinz gave to Perry.

The key is a series of numbers generated by multiplying second number B with P digits from the first number A, from left to right. Here, P is the number of digits in B.

INPUT:

First line gives T, total number of test cases. T lines follow, each with 2 numbers A and B.

OUTPUT:

For each Test case, print all the numbers generated by multiplying P digits of A with B.

For example, if the number A is 12345 and B is 11, 11 is multiplied by 12 then 23, then 34 and so on.

Constraints:

  • 1 <= T <= 10
  • 1 <= A,B <= 10^9
Time Limit: 1
Memory Limit: 1
Source Limit:
Explanation

2254 = 98 X 23

2001 = 87 X 23

and so on.

Editor Image

?