P1100 Swap High and Low Bits
Description
You are given a non-negative integer less than $2^{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 $1314520$ is represented in binary as $0000\,0000\,0001\,0100\,0000\,1110\,1101\,1000$ (with $11$ leading zeros added to make it 32 bits), where the high 16 bits are $0000\,0000\,0001\,0100$, and the low 16 bits are $0000\,1110\,1101\,1000$. After swapping the high and low bits, we get a new binary number $0000\,1110\,1101\,1000\,0000\,0000\,0001\,0100$. This is $249036820$ in decimal.
Input Format
A non-negative integer less than $2^{32}$.
Output Format
Output the new number.
Explanation/Hint
Translated by ChatGPT 5