#P1100. 高低位交换

高低位交换

Description

You are given a non-negative integer less than 2322^{32}. This number can be represented as a 32-bit binary number (pad with leading zeros if it has fewer than 32 bits). We call the first 16 bits the high 16 bits, and the last 16 bits the low 16 bits. Swap its high and low 16 bits to obtain a new number. What is this new number (in decimal)?

For example, the number 13145201314520 is represented in binary as 000000000001010000001110110110000000\,0000\,0001\,0100\,0000\,1110\,1101\,1000 (with 1111 leading zeros added to make it 32 bits), where the high 16 bits are 00000000000101000000\,0000\,0001\,0100, and the low 16 bits are 00001110110110000000\,1110\,1101\,1000. After swapping the high and low bits, we get a new binary number 000011101101100000000000000101000000\,1110\,1101\,1000\,0000\,0000\,0001\,0100. This is 249036820249036820 in decimal.

Input Format

A non-negative integer less than 2322^{32}.

Output Format

Output the new number.

1314520

249036820

Hint

Translated by ChatGPT 5