Leaderboard
Showing:
Base Conversion
Basic Accuracy: 33.87% Submissions: 683 Points: 1

Given a number in decimal convert it to binary, a number in binary to decimal, decimal to hexadecimal and hexadecimal to decimal.

Input:

The first line of input takes the number of test cases, T . Then T test cases follow

Each test case contains  4 space separated integers, A in decimal, B binary,C decimal and D hexadecimal respectively.

Output:

Print 4 space separated integers representing the binary equivalent of A, decimal equivalent of B, hexadecimal equivalent of C and decimal equivalent of D respectively.

Constraints:

1<=T<=100

1<=A,C<=500

1<=B<=100000(base 2)

1<=D<=100000(base 16)

Example:

Input:
3
6 110 20 2A
10 111 25 FA
23 1011 22 FB4

Output:
110 6 14 42
1010 7 19 250
10111 11 16 4020

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Base Conversion

Output Window