By Ricardo Martins, IFSULDEMINAS Brazil
Print numbers in sequence is a relatively simple task. But, and when it is a sequence mirror? This is a sequence having a number of start and an end number and all numbers therebetween, including these, are arranged in an increasing sequence without spaces, and then this sequence is designed in inverted form, as a reflection in the mirror. For example, if the sequence is 7 to 12, the result would 789101112211101987
Write a program that, given two integers, print their mirror sequence.
The input has an integer value C indicating the number of test cases. Then each case has two integer values E and B ( 1 ≤ B ≤ E ≤ 12221 ), indicating the start and end of the sequence.
For each test case, print the respective mirror sequence.
Input Sample | Output Sample |
3 1 5 10 13 98 101 |
1234554321 1011121331211101 98991001011010019989 |