Mystery 2

5

1 votes
Problem

We have an unsolved mystery this time too!

Input:

First line of input contains T – the number of test cases. Each of the next T lines contain two integers a and b separated by a space.

Output:

Output T lines, each containing a single integer that is the output of that test case.

Constraints:

1<=T<=300

1<=a<=999

5<=b<=8

Sample Input
6
5 5
10 6
2 7
90 6
5 6
2 8
Sample Output
10
14
2
230
5
2
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

No explanation!!

Contributers:
Editor Image

?