In an ordinary multiplication table the last term holds the largest value. In a reversed multiplication table each term stores the product with its decimal digits written in reverse order, so the largest value is not always the last one.
For example, the nine terms of the table of 8 are 8, 16, 24, 32, 40, 48, 56, 64, 72, and 72 is the largest among them. In the reversed table the same terms become 8, 61, 42, 23, 4, 84, 65, 46, 27, and the largest value is 84. Reversing 40 gives 04, and the zero left at the front is dropped, so that term counts as 4.
You are given the table number N and the number of terms K. Write a program that prints the largest number obtained by reversing each of N×1 through N×K.