시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 64 MB | 5 | 5 | 5 | 100.000% |
Conventional number systems of fixed-radix r consisting of digits that are in range {0, 1, …, r – 1}. The interpretation rule for calculating the numerical value of the sequence (xn-1, xn-2, … , x0) is
\[X = \sum_{i=0}^{n-1}{x_ir^i}\]
We are interested in implementing a computer program to convert 8-digit, radix 32 numbers to radix 10 and radix 2 numbers, respectively. The following ranges R2, R10 and R32 are sets of possible digits for radix 32, 10 and 2 systems, respectively.
The first number n (1<= n <= 100) indicates the number of test cases. Then n radix 32 numbers are entered. Each radix number is no more than 8 digits.
For each input, two integers are printed on a separate lines indicating a radix 10 number followed by a radix 2 number of the given radix 32 number.
4 32 A7 CAT ALL41
98 0001100010 327 0101000111 12637 011000101011101 11195521 0101010101101010010000001