Problem1035--Number System 2

1035: Number System 2

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

Given a positive integer (10 base), please convert it to X base number.

Input

The first line contains an integer T which is the number of cases.
In the following T line, there are two fields in each line, the first field is the number and the second field is the base.  (for this problem, use int as data type is good enough)
(you can assume all are positive integers)

Output

For each case, please output the number in its required base. For each digit K, please use (K) to represent it and no spaces between the characters.

Sample Input Copy

3
10230 60
5 2
271 16

Sample Output Copy

(2)(50)(30)
(1)(0)(1)
(1)(0)(15)

Source/Category